/*
 * MergeReady base: reset, type roles, controls and the route vocabulary.
 * Shared by the brand book, the landing page, the prototype and the walkthrough.
 * Requires tokens.css and fonts/fonts.css.
 */
*,
*::before,
*::after {
	box-sizing: border-box;
}
html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}
body {
	margin: 0;
	background: var(--ground);
	color: var(--ink);
	font-family: var(--font-text);
	font-size: var(--step-body);
	line-height: 1.55;
	font-kerning: normal;
	font-variant-numeric: lining-nums;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
}
img,
svg,
video {
	display: block;
	max-width: 100%;
}
svg {
	overflow: visible;
}
button,
input,
select,
textarea {
	font: inherit;
	color: inherit;
	line-height: 1.3;
}
h1,
h2,
h3,
h4 {
	margin: 0;
	font-family: var(--font-sign);
	font-weight: 700;
	line-height: 0.98;
	letter-spacing: -0.015em;
	text-wrap: balance;
}
p,
li,
dd,
td,
figcaption {
	text-wrap: pretty;
}
p {
	margin: 0;
}
ul,
ol {
	margin: 0;
	padding: 0;
}
code,
kbd,
pre,
samp {
	font-family: var(--font-code);
	font-size: 0.9em;
}
a {
	color: inherit;
	text-decoration-line: underline;
	text-decoration-thickness: 0.08em;
	text-underline-offset: 0.2em;
	text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
	transition: text-decoration-color var(--t-fast) var(--ease-out);
}
a:hover {
	text-decoration-color: currentColor;
}
::selection {
	background: var(--yellow);
	color: var(--yellow-ink);
}
:focus-visible {
	/* Two bands, light inside and dark outside, so the ring shows on porcelain, black, white and yellow alike. */
	outline: 3px solid var(--focus-out);
	outline-offset: 3px;
	box-shadow: 0 0 0 3px var(--focus-in);
}
html {
	scrollbar-color: var(--rule-strong) transparent;
}
::-webkit-scrollbar {
	width: 12px;
	height: 12px;
}
::-webkit-scrollbar-thumb {
	background: var(--rule-strong);
	border: 3px solid var(--ground);
	border-radius: 999px;
}
.tabular {
	font-variant-numeric: tabular-nums;
}
.visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}
.skip-link {
	position: absolute;
	left: var(--margin);
	top: -100px;
	z-index: 100;
	padding: 12px 18px;
	background: var(--yellow);
	color: var(--yellow-ink);
	font-weight: 600;
	border-radius: var(--pill);
	text-decoration: none;
}
.skip-link:focus {
	top: 12px;
}

/* ---------------------------------------------------------------------------
 * Buttons. One shape (the pill, from the route bullet), three meanings.
 * person: yellow, a decision only a person makes (start, approve, answer)
 * primary: sign black, the main machine action on a screen
 * quiet: a step of tone, everything else
 * ------------------------------------------------------------------------- */
.btn {
	--btn-bg: var(--quiet);
	--btn-ink: var(--ink);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.55em;
	min-height: 44px;
	padding: 0.6em 1.25em;
	border: 0;
	border-radius: var(--pill);
	background: var(--btn-bg);
	color: var(--btn-ink);
	font-family: var(--font-text);
	font-weight: 600;
	font-size: 1rem;
	line-height: 1.3;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition:
		transform var(--t-fast) var(--ease-out),
		background-color var(--t-fast) var(--ease-out),
		box-shadow var(--t-fast) var(--ease-out);
}
.btn:hover {
	background: color-mix(in srgb, var(--btn-bg) 88%, var(--ink));
}
.btn:active {
	transform: translateY(1px) scale(0.98);
}
.btn[disabled],
.btn[aria-disabled="true"] {
	opacity: 0.45;
	cursor: not-allowed;
	transform: none;
}
.btn--person {
	--btn-bg: var(--yellow);
	--btn-ink: var(--yellow-ink);
}
.btn--person:hover {
	background: #f2c200;
}
.btn--primary {
	--btn-bg: var(--ink);
	--btn-ink: var(--ground);
}
.btn--primary:hover {
	background: color-mix(in srgb, var(--ink) 82%, var(--ground));
}
.btn--stop {
	--btn-bg: var(--red);
	--btn-ink: var(--red-on);
}
.btn--stop:hover {
	background: color-mix(in srgb, var(--red) 86%, var(--ink));
}
/* The quieter stop (the sidebar's Pause): red words on a control edge. */
.btn--stop-outline {
	--btn-bg: transparent;
	--btn-ink: var(--red);
	box-shadow: inset 0 0 0 1.5px var(--control-edge);
}
.btn--stop-outline:hover {
	background: var(--quiet);
}
/* An icon button beside other controls (close, move, the theme): no fill until hovered, square at 44px. */
.btn--ghost {
	--btn-bg: transparent;
}
.btn--ghost:hover {
	background: var(--quiet);
}
.btn--lg {
	min-height: 56px;
	padding: 0.7em 1.6em;
	font-size: 1.125rem;
}
.btn--sm {
	min-height: 44px;
	padding: 0.45em 1em;
	font-size: 0.9375rem;
}
.btn svg {
	width: 1.1em;
	height: 1.1em;
	flex: none;
}

/* The wayfinding arrow: a filled sign arrow, never a glyph. */
.arrow {
	display: inline-block;
	width: 1em;
	height: 1em;
	flex: none;
	vertical-align: -0.12em;
}

/* ---------------------------------------------------------------------------
 * Route bullets: the level dial. A circle with its number, like a line bullet.
 * ------------------------------------------------------------------------- */
.bullet {
	--b-bg: var(--ink);
	--b-ink: var(--ground);
	display: inline-grid;
	place-items: center;
	width: 1.6em;
	height: 1.6em;
	flex: none;
	border-radius: 50%;
	background: var(--b-bg);
	color: var(--b-ink);
	font-family: var(--font-sign);
	font-weight: 700;
	font-size: 1em;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}
.bullet--off {
	--b-bg: transparent;
	--b-ink: var(--ink);
	box-shadow: inset 0 0 0 0.12em currentColor;
}
.bullet--person {
	--b-bg: var(--yellow);
	--b-ink: var(--yellow-ink);
}

/* ---------------------------------------------------------------------------
 * Station marks: every state has a shape. Colour repeats the shape, never replaces it.
 * Use <svg class="mark"><use href="#m-ready"/></svg> with the sprite in icons.svg
 * (inlined per page), always beside the status word.
 * ------------------------------------------------------------------------- */
.mark {
	width: 1.15em;
	height: 1.15em;
	flex: none;
	vertical-align: -0.2em;
}
.status {
	display: inline-flex;
	align-items: center;
	gap: 0.45em;
	font-weight: 600;
	white-space: nowrap;
}
.status--ready {
	color: var(--green);
}
.status--refused {
	color: var(--red);
}
.status--muted {
	color: var(--muted);
}

/* Code: real code only (YAML, CLI, diffs). */
.code {
	margin: 0;
	padding: 1.1em 1.25em;
	background: var(--panel);
	color: var(--ink);
	font-family: var(--font-code);
	font-size: 0.875rem;
	line-height: 1.65;
	white-space: pre;
	overflow-x: auto;
	tab-size: 2;
	border-radius: var(--radius);
}
.code .k {
	font-weight: 600;
}
.code .c {
	color: var(--muted);
}
.code .s {
	color: var(--green);
}
.code .hl {
	background: var(--yellow);
	color: var(--yellow-ink);
	border-radius: 2px;
	box-shadow: 0 0 0 0.2em var(--yellow);
}
.terminal {
	background: #121212;
	color: #f4f4f2;
}
.terminal .c {
	color: #a8a8a0;
}
.terminal .s {
	color: #3fbf7f;
}
.terminal .y {
	color: #ffcc00;
}
.terminal .r {
	color: #ff7a6e;
}

/* Toggle switch: a real control (role=switch), 44px target. */
.switch {
	--sw-w: 2.25em;
	--sw-h: 1.3em;
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
}
.switch__track {
	position: relative;
	width: var(--sw-w);
	height: var(--sw-h);
	border-radius: var(--pill);
	background: var(--control-edge);
	transition: background-color var(--t-mid) var(--ease-out);
}
.switch__track::after {
	content: "";
	position: absolute;
	top: 0.15em;
	left: 0.15em;
	width: calc(var(--sw-h) - 0.3em);
	height: calc(var(--sw-h) - 0.3em);
	border-radius: 50%;
	background: var(--panel);
	transition: transform var(--t-mid) var(--ease-out);
}
.switch[aria-checked="true"] .switch__track {
	background: var(--ink);
}
.switch[aria-checked="true"] .switch__track::after {
	transform: translateX(calc(var(--sw-w) - var(--sw-h)));
	background: var(--yellow);
}
.switch:disabled {
	cursor: not-allowed;
	opacity: 0.5;
}

/* Fields */
.field {
	display: grid;
	gap: 6px;
}
.field__label {
	font-weight: 600;
	font-size: 0.9375rem;
}
.field__hint {
	color: var(--muted);
	font-size: 0.875rem;
}
.input,
.select {
	min-height: 44px;
	width: 100%;
	padding: 0.5em 0.75em;
	border: 1px solid var(--control-edge);
	border-radius: var(--radius);
	background: var(--panel);
	color: var(--ink);
}
.input::placeholder {
	color: var(--muted);
	opacity: 1;
}

/* Entrance helper: content is visible by default; JS adds .will-rise only when motion is allowed. */
.will-rise {
	opacity: 0;
	transform: translateY(24px);
}
.rise {
	opacity: 1;
	transform: none;
	transition:
		opacity var(--t-slow) var(--ease-out),
		transform var(--t-slow) var(--ease-out);
}
@media (prefers-reduced-motion: reduce) {
	.will-rise {
		opacity: 1;
		transform: none;
	}
	*,
	*::before,
	*::after {
		transition-duration: 1ms !important;
		animation-duration: 1ms !important;
		animation-iteration-count: 1 !important;
	}
}
