/*
 * GrayPass design system.
 *
 * One system for every surface served by app.graypass.org: demo, docs,
 * console, status, legal pages, 404, and the consent screen. It mirrors the
 * public site at graypass.org: paper is the normal environment, ink is
 * authority and structure, one pink-red marks continuity, risk, and
 * verification, and gray is historical or inactive state. Two registers share
 * the same role names; light is the default and dark marks the live system
 * (results, proofs, the footer).
 *
 * Geist Sans is the interface voice: headings, body, navigation, controls,
 * labels. Geist Mono is reserved for code, JSON, identifiers, and proofs,
 * where character distinction and indentation matter.
 *
 * Every font and asset is first-party. The Content Security Policy is
 * style-src 'self', so nothing here depends on inline styles.
 */

@font-face {
  font-family: "Geist";
  src: url("/fonts/Geist-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/GeistMono-Regular.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

/* ── tokens ─────────────────────────────────────────────────────────── */

:root,
.register-light {
  --bg: #f4f4f1;
  --surface: #fbfbf9;
  --surface-2: #ebebe7;
  --surface-3: #deded8;
  --fg: #101114;
  --muted: #43474f;
  --faint: #5d6370;
  --line: rgba(16, 17, 20, 0.12);
  --line-strong: rgba(16, 17, 20, 0.3);
  --pink: #e64a5d;
  --pink-text: #c92e41;
  --pink-soft: rgba(230, 74, 93, 0.14);
  --hist: #8f949d;
  --proof: #fbfbf9;
  --focus: #c92e41;
  --button-bg: #101114;
  --button-fg: #f4f4f1;
  --button-hover: #26282e;
  --ok: #2e7d54;
  --warn: #a5701c;
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --header-h: 64px;
  color-scheme: light;
}

.register-dark {
  --bg: #101114;
  --surface: #141519;
  --surface-2: #17181c;
  --surface-3: #202228;
  --fg: #edeef0;
  --muted: #9ba1ac;
  --faint: #858b96;
  --line: rgba(237, 238, 240, 0.14);
  --line-strong: rgba(237, 238, 240, 0.34);
  --pink: #e64a5d;
  --pink-text: #ff7080;
  --pink-soft: rgba(230, 74, 93, 0.18);
  --hist: #686d77;
  --proof: #f4f4f1;
  --focus: #ff7080;
  --button-bg: #edeef0;
  --button-fg: #101114;
  --button-hover: #f4f4f1;
  --ok: #7fc9a4;
  --warn: #e0b26a;
  color-scheme: dark;
  background: var(--bg);
  color: var(--fg);
}

/* ── base ───────────────────────────────────────────────────────────── */

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

html {
  background: #f4f4f1;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11", "tnum";
}

main {
  flex: 1 0 auto;
}

main:focus {
  outline: none;
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

::selection {
  background: var(--pink-soft);
}

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

[id] {
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

img,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

code,
kbd,
pre,
.mono {
  font-family: var(--font-mono);
  font-variant-ligatures: none;
  font-variant-numeric: tabular-nums;
}

code {
  font-size: 0.875em;
  padding: 0.08em 0.35em;
  border-radius: 4px;
  background: var(--surface-2);
  overflow-wrap: anywhere;
}

pre code {
  padding: 0;
  border-radius: 0;
  background: none;
  font-size: inherit;
  overflow-wrap: normal;
}

/* ── layout ─────────────────────────────────────────────────────────── */

.wrap,
.wrap-wide,
.wrap-read {
  width: 100%;
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 4vw, 3rem);
}

.wrap {
  max-width: 1200px;
}

.wrap-wide {
  max-width: 1440px;
}

.wrap-read {
  max-width: 800px;
}

.chapter {
  padding-block: clamp(2.5rem, 5vw, 4.5rem);
}

.chapter-tight {
  padding-block: clamp(1.75rem, 3.5vw, 3rem);
}

.measure {
  max-width: 65ch;
}

.measure-short {
  max-width: 48ch;
}

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

/* ── type ───────────────────────────────────────────────────────────── */

.type-display {
  font-size: clamp(2.4rem, 1.4rem + 3vw, 4.4rem);
  font-weight: 400;
  letter-spacing: -0.038em;
  line-height: 0.98;
  text-wrap: balance;
}

.type-h1 {
  font-size: clamp(2rem, 1.3rem + 2vw, 3.2rem);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.02;
  text-wrap: balance;
}

.type-h2 {
  font-size: clamp(1.5rem, 1.15rem + 1.1vw, 2.1rem);
  font-weight: 450;
  letter-spacing: -0.03em;
  line-height: 1.1;
  text-wrap: balance;
}

.type-h3 {
  font-size: clamp(1.1rem, 1.02rem + 0.3vw, 1.3rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  text-wrap: balance;
}

.type-h4 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.type-lede {
  color: var(--muted);
  font-size: clamp(1.05rem, 0.98rem + 0.3vw, 1.2rem);
  font-weight: 400;
  line-height: 1.5;
  text-wrap: pretty;
}

.type-body {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.58;
}

.type-small {
  font-size: 0.9rem;
  line-height: 1.5;
}

.type-label {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  line-height: 1.3;
}

.type-caps {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  line-height: 1.3;
  text-transform: uppercase;
}

.type-mono {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  font-variant-ligatures: none;
  letter-spacing: 0.01em;
  line-height: 1.5;
}

/* The section marker: a short hairline and a quiet label. */
.marker,
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--faint);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.005em;
}

.marker::before,
.eyebrow::before {
  width: 1.25rem;
  height: 1px;
  background: var(--line-strong);
  content: "";
  flex: none;
}

.emph {
  color: var(--pink-text);
}

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

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

.lede {
  color: var(--muted);
  font-size: clamp(1.02rem, 0.98rem + 0.25vw, 1.15rem);
  line-height: 1.5;
  max-width: 62ch;
  text-wrap: pretty;
}

.fineprint {
  color: var(--faint);
  font-size: 0.875rem;
  line-height: 1.5;
  max-width: 68ch;
}

/* ── buttons and links ──────────────────────────────────────────────── */

.btn,
.primary,
.secondary,
.quiet,
a.secondary {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0.6rem 1.05rem;
  font-size: 0.925rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.btn-solid,
.primary {
  border-color: var(--button-bg);
  background: var(--button-bg);
  color: var(--button-fg);
}

.btn-solid:hover,
.primary:hover {
  border-color: var(--button-hover);
  background: var(--button-hover);
}

/* Pink is the signature. It marks the one live product entry on paper. */
.btn-pink {
  border-color: var(--pink);
  background: var(--pink);
  color: #101114;
}

.btn-pink:hover {
  border-color: #ff7080;
  background: #ff7080;
}

.btn-outline,
.secondary,
a.secondary {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--fg);
}

.btn-outline:hover,
.secondary:hover,
a.secondary:hover {
  border-color: var(--fg);
}

.quiet {
  min-height: 36px;
  border-color: var(--line);
  background: var(--surface);
  color: var(--fg);
  padding: 0.45rem 0.8rem;
  font-size: 0.85rem;
}

.quiet:hover {
  border-color: var(--line-strong);
}

.compact,
.btn-sm {
  min-height: 34px;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}

.destructive,
.danger,
.btn-danger {
  border-color: var(--pink);
  background: transparent;
  color: var(--pink-text);
}

.destructive:hover,
.danger:hover,
.btn-danger:hover {
  background: var(--pink-soft);
}

.btn[disabled],
.primary[disabled],
.secondary[disabled],
.quiet[disabled],
button[disabled] {
  cursor: default;
  opacity: 0.55;
}

.btn-text {
  padding-inline: 0.25rem;
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 0.3em;
}

.btn-text:hover {
  text-decoration-color: currentColor;
}

.text-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 0.4rem;
  color: var(--fg);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 0.28em;
}

.text-link:hover {
  text-decoration-color: currentColor;
}

.text-link[data-arrow]::after {
  content: "\2192";
}

.prose-link,
.prose a,
.docs-content a,
.legal-copy a {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 0.22em;
  transition: text-decoration-color 160ms ease;
}

.prose-link:hover,
.prose a:hover,
.docs-content a:hover,
.legal-copy a:hover {
  text-decoration-color: currentColor;
}

/* ── surfaces ───────────────────────────────────────────────────────── */

.panel,
.callout,
.card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.panel-pad,
.callout {
  padding: 1rem 1.15rem;
}

.callout {
  display: grid;
  gap: 0.5rem;
  border-left: 3px solid var(--line-strong);
}

.callout h2,
.callout h3 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

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

.callout.error {
  border-left-color: var(--pink);
}

.callout.error h2 {
  color: var(--pink-text);
}

.note {
  border-left: 2px solid var(--line-strong);
  padding-left: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/*
 * Matte surfaces: a faint procedural grain gives drawn plates the paper
 * finish of the public site without shipping a texture.
 */
.matte {
  position: relative;
  isolation: isolate;
}

.matte::after {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
  opacity: 0.045;
  border-radius: inherit;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 1 0'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
  background-size: 160px 160px;
}

.register-dark .matte::after {
  opacity: 0.07;
}

.matte > * {
  position: relative;
  z-index: 1;
}

/* ── decisions and pills ────────────────────────────────────────────── */

.decision-badge {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.8rem 0.35rem 0.55rem;
  background: var(--surface);
  color: var(--fg);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.decision-badge::before {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  background: currentColor;
  content: "";
  flex: none;
}

.decision-badge[data-decision="allow"] {
  background: var(--proof);
  color: #101114;
  border-color: rgba(16, 17, 20, 0.2);
}

.decision-badge[data-decision="challenge"] {
  color: var(--pink-text);
  border-color: var(--pink);
}

.decision-badge[data-decision="challenge"]::before {
  border: 2px solid currentColor;
  background: transparent;
}

.decision-badge[data-decision="hold"] {
  color: var(--muted);
}

.decision-badge[data-decision="hold"]::before {
  border-radius: 2px;
  background: repeating-linear-gradient(135deg, currentColor 0 1px, transparent 1px 3px);
}

.decision-badge[data-decision="deny"] {
  background: var(--pink);
  color: #101114;
  border-color: var(--pink);
}

.decision-badge[data-decision="deny"]::before {
  border-radius: 1px;
}

.decision-badge[data-size="lg"] {
  min-height: 40px;
  padding: 0.5rem 1.05rem 0.5rem 0.75rem;
  font-size: 0.95rem;
}

.pill,
.badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  color: var(--fg);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.3;
  white-space: nowrap;
}

.pill[data-tone="pink"],
.badge-enforce,
.badge-challenge,
.badge-deny {
  border-color: var(--pink);
  color: var(--pink-text);
}

.badge-deny {
  background: var(--pink-soft);
}

.pill[data-tone="muted"],
.badge-shadow,
.badge-hold {
  border-color: var(--line-strong);
  color: var(--muted);
}

.pill[data-tone="faint"],
.badge-test {
  border-color: var(--line);
  color: var(--faint);
}

.pill[data-tone="ink"],
.badge-allow {
  border-color: var(--fg);
  color: var(--fg);
}

/* ── code ───────────────────────────────────────────────────────────── */

.code-shell,
.code-sample {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.code-head {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  padding-inline: 0.9rem;
  color: var(--faint);
  font-size: 0.8125rem;
  font-weight: 600;
}

.code-block,
pre {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  padding: 0.9rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-variant-ligatures: none;
  line-height: 1.6;
  white-space: pre;
  tab-size: 2;
  color: var(--fg);
}

pre code {
  display: block;
  width: max-content;
  min-width: 100%;
}

.code-block .tok-key,
.code-block .tok-kw {
  color: var(--fg);
}

.code-block .tok-str {
  color: var(--pink-text);
}

.code-block .tok-num,
.code-block .tok-com {
  color: var(--faint);
}

.copy-code {
  position: absolute;
  top: 0.45rem;
  right: 0.55rem;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.3rem 0.6rem;
  background: var(--surface);
  color: var(--fg);
  font-size: 0.78rem;
  font-weight: 600;
}

.copy-code:hover {
  border-color: var(--line-strong);
}

.code-sample > pre {
  padding-top: 2.6rem;
}

.code-head + .code-block,
.code-head + pre {
  padding-top: 0.9rem;
}

.code-shell > .code-head ~ .copy-code {
  top: 0.3rem;
}

/* ── controls ───────────────────────────────────────────────────────── */

.segmented,
.tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: 8px;
  background: var(--surface-2);
}

.segmented button,
.tabs button {
  min-height: 38px;
  border-radius: 5px;
  padding: 0.5rem 0.85rem;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition:
    background-color 160ms ease,
    color 160ms ease;
}

.segmented button:hover,
.tabs button:hover {
  color: var(--fg);
}

.segmented button[aria-pressed="true"],
.segmented button[aria-selected="true"],
.segmented button[disabled],
.tabs button[aria-selected="true"] {
  background: var(--surface);
  color: var(--fg);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(16, 17, 20, 0.08);
  opacity: 1;
}

label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  padding: 0.65rem 0.75rem;
  font-size: 0.95rem;
  color: var(--fg);
  transition: border-color 160ms ease;
}

input:not([type="checkbox"]):not([type="radio"]),
select {
  height: 44px;
  padding-block: 0;
}

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.2rem;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1.5l5 5 5-5' fill='none' stroke='%2343474f' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
}

.register-dark select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1.5l5 5 5-5' fill='none' stroke='%239ba1ac' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}

textarea {
  min-height: 5.5rem;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.55;
}

input:not([type="checkbox"]):not([type="radio"]):hover,
select:hover,
textarea:hover {
  border-color: var(--fg);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-color: var(--fg);
}

::placeholder {
  color: var(--faint);
  opacity: 1;
}

input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  accent-color: #101114;
  flex: none;
}

.register-dark input[type="checkbox"] {
  accent-color: #edeef0;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.45;
}

.check input {
  margin-top: 0.2rem;
}

.field {
  display: grid;
  gap: 0.45rem;
}

form {
  display: grid;
  gap: 0.85rem;
  max-width: 40rem;
}

form label + input,
form label + select,
form label + textarea {
  margin-top: -0.4rem;
}

form button[type="submit"] {
  justify-self: start;
}

/* ── tables ─────────────────────────────────────────────────────────── */

.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  line-height: 1.45;
}

thead th {
  padding: 0.5rem 0.75rem 0.6rem;
  border-bottom: 1px solid var(--line-strong);
  color: var(--faint);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

tbody th,
tbody td {
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

tbody th {
  font-weight: 600;
  white-space: nowrap;
}

tbody tr:last-child td,
tbody tr:last-child th {
  border-bottom-color: transparent;
}

table code {
  font-size: 0.8rem;
}

th:first-child,
td:first-child {
  padding-left: 0;
}

th:last-child,
td:last-child {
  padding-right: 0;
}

dl.meta,
.meta {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.45rem 1.25rem;
  font-size: 0.9rem;
}

.meta dt {
  color: var(--faint);
  font-weight: 600;
}

.meta dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* ── the stepper: square nodes on a hairline rail ───────────────────── */

.stepper {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0;
  border-left: 1px solid var(--line-strong);
}

.stepper > li {
  position: relative;
  padding: 0.35rem 0 1.1rem 1.5rem;
}

.stepper > li:last-child {
  padding-bottom: 0.35rem;
}

.stepper > li::before {
  position: absolute;
  left: -6.5px;
  top: 0.72rem;
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--fg);
  border-radius: 3px;
  background: var(--bg);
  content: "";
}

.stepper > li[data-state="live"]::before,
.stepper > li.is-live::before {
  border-color: var(--pink);
  background: var(--pink);
}

.stepper > li[data-state="proof"]::before,
.stepper > li.is-proof::before {
  border-color: var(--fg);
  background: var(--proof);
}

.stepper > li[data-state="hist"]::before,
.stepper > li.is-hist::before {
  border-color: var(--hist);
}

.stepper-row {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1rem 1.25rem;
}

.stepper-row > li {
  position: relative;
  min-width: 0;
}

.stepper-row .node-line {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.stepper-row .node {
  width: 12px;
  height: 12px;
  flex: none;
  border: 1.5px solid var(--fg);
  border-radius: 3px;
  background: var(--fg);
}

.stepper-row .node[data-state="live"] {
  border-color: var(--pink);
  background: var(--pink);
}

.stepper-row .node[data-state="proof"] {
  border-color: var(--fg);
  background: var(--proof);
}

.stepper-row .node[data-state="hist"] {
  border-color: var(--hist);
  background: var(--bg);
}

.stepper-row .node-line::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line-strong);
}

.stepper-row > li:last-child .node-line::after {
  background: transparent;
}

.stepper-row .node-title {
  margin-top: 0.7rem;
  font-size: 1rem;
  font-weight: 600;
}

.stepper-row .node-title[data-state="live"] {
  color: var(--pink-text);
}

.stepper-row .node-copy {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ── the thread and boundary glyphs (SVG) ───────────────────────────── */

.thread-hist {
  stroke: var(--hist);
}

.thread-live {
  stroke: var(--pink);
}

.boundary-line {
  stroke: var(--pink);
}

.node-hist {
  fill: var(--bg);
  stroke: var(--hist);
}

.node-live {
  fill: var(--pink);
  stroke: var(--pink);
}

.node-proof {
  fill: var(--proof);
  stroke: var(--fg);
}

.pulse-soft {
  animation: pulse-soft 2.8s ease-in-out infinite;
}

@keyframes pulse-soft {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

.draw-in {
  stroke-dasharray: var(--len, 1000);
  stroke-dashoffset: var(--len, 1000);
  animation: draw-in 1.6s cubic-bezier(0.3, 0.7, 0.2, 1) forwards;
}

@keyframes draw-in {
  to {
    stroke-dashoffset: 0;
  }
}

.state-swap {
  animation: state-swap 420ms cubic-bezier(0.3, 0.7, 0.2, 1) both;
}

@keyframes state-swap {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ── the header: one arrangement on every page ─────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(16, 17, 20, 0.14);
  background: rgba(244, 244, 241, 0.82);
  color: #101114;
  box-shadow:
    0 1px 0 rgba(251, 251, 249, 0.78) inset,
    0 8px 28px rgba(16, 17, 20, 0.05);
  backdrop-filter: blur(18px) saturate(1.12);
  -webkit-backdrop-filter: blur(18px) saturate(1.12);
}

.site-header > .wrap,
.site-header > .wrap-wide {
  display: flex;
  min-height: var(--header-h);
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 44px;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.wordmark img,
.wordmark-tile {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(16, 17, 20, 0.1);
}

.wordmark-text {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.035em;
}

.wordmark-text span {
  color: var(--faint);
  font-weight: 450;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.4rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  position: relative;
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: #43474f;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: color 160ms ease;
}

.nav-link::after {
  position: absolute;
  right: 0;
  bottom: 6px;
  left: 0;
  height: 2px;
  border-radius: 999px;
  background: #e64a5d;
  content: "";
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 220ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-link[aria-current="page"] {
  color: #101114;
}

.nav-link:hover::after,
.nav-link:focus-visible::after,
.nav-link[aria-current="page"]::after {
  transform: scaleX(1);
  transform-origin: left center;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.header-controls select {
  height: 38px;
  width: auto;
  min-width: 8.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.header-controls .visually-hidden-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 620px) {
  .site-header > .wrap,
  .site-header > .wrap-wide {
    flex-wrap: wrap;
    padding-block: 0.4rem;
    row-gap: 0;
  }

  .site-nav {
    order: 3;
    width: 100%;
    gap: clamp(0.5rem, 2vw, 1.1rem);
    overflow-x: auto;
    scrollbar-width: none;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .site-header nav {
    width: 100%;
    min-width: 0;
  }

  .nav-link {
    min-height: 40px;
    font-size: 14px;
  }

  .wordmark-text span {
    display: none;
  }
}

/* ── the footer ─────────────────────────────────────────────────────── */

.site-footer {
  flex: none;
  border-top: 1px solid var(--line);
}

.site-footer > .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-block: 1.6rem;
}

.site-footer .wordmark img {
  width: 30px;
  height: 30px;
}

.site-footer .wordmark-text {
  font-size: 15px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links a {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  color: var(--muted);
  font-size: 0.875rem;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--fg);
}

.site-header .nav-about,
.site-footer .nav-about,
.console-destinations .nav-about {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--pink);
  color: #101114;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 160ms ease;
}

.nav-about::after {
  display: none;
}

.site-header .nav-about:hover,
.site-footer .nav-about:hover,
.console-destinations .nav-about:hover {
  background: #f06373;
  color: #101114;
}

.site-header .nav-about:focus-visible,
.site-footer .nav-about:focus-visible,
.console-destinations .nav-about:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
}

.footer-meta {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 1.5rem;
  color: var(--faint);
  font-size: 0.8125rem;
}

.footer-meta a {
  color: inherit;
}

/* ── accessibility ──────────────────────────────────────────────────── */

.skip-link {
  position: fixed;
  z-index: 200;
  top: -5rem;
  left: 1rem;
  border-radius: 6px;
  background: #101114;
  color: #f4f4f1;
  padding: 0.75rem 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: top 120ms ease;
}

.skip-link:focus {
  top: 1rem;
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0s !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0s !important;
  }

  .draw-in {
    stroke-dashoffset: 0;
  }

  .pulse-soft {
    opacity: 1;
  }
}

@media print {
  .site-header,
  .site-footer,
  .skip-link {
    display: none !important;
  }

  body {
    background: white;
    color: black;
    font-size: 11pt;
  }

  a {
    text-decoration: none;
  }
}
