/*
 * KodeStudio theme styles.
 *
 * Palette: paper (drawing board), graphite (code, text) and signal orange
 * (the safety colour of workshops and industry).
 * Type: Archivo (variable width + weight) and Fragment Mono for code/data.
 */

/* Fonts (self-hosted, OFL) ------------------------------------------------ */

@font-face {
	font-family: "Archivo";
	src: url("../fonts/archivo-var.woff2") format("woff2");
	font-weight: 100 900;
	font-stretch: 62% 125%;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Fragment Mono";
	src: url("../fonts/fragment-mono.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

/* Tokens ------------------------------------------------------------------ */

:root {
	--paper: #F2F3EF;
	--paper-2: #E6E8E3;
	--sheet: #FAFAF8;
	--line: #C5CAC4;
	--line-soft: #DCDFDA;
	--grid: rgba(30, 34, 38, 0.055);
	--steel: #5E666E;
	--steel-dk: #9AA3AB;
	--grafit: #1E2226;
	--grafit-2: #2B3036;
	--grafit-3: #3A4047;
	--signal: #F2551D;
	--signal-ink: #B8400F;
	--signal-wash: #FBE6DD;

	--code-text: #E3E7EA;
	--code-dim: #8E979F;
	--code-tag: #F59A70;
	--code-attr: #B4BDC5;
	--code-str: #E7D7A8;

	--font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--mono: "Fragment Mono", ui-monospace, Menlo, Consolas, monospace;

	--step--1: 0.875rem;
	--step-0: 1.0625rem;
	--step-1: 1.25rem;
	--step-2: clamp(1.4rem, 1.2rem + 0.6vw, 1.66rem);
	--step-3: clamp(1.65rem, 1.3rem + 1.1vw, 2.1rem);
	--step-4: clamp(2.1rem, 1.5rem + 2.4vw, 3.4rem);
	--step-5: clamp(2.4rem, 1.4rem + 3.9vw, 4.6rem);

	--gutter: clamp(16px, 3vw, 32px);
	--max: 1320px;
	--radius: 4px;
	--radius-lg: 8px;
	--header-h: 68px;
	--ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Base -------------------------------------------------------------------- */

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

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
	margin: 0;
	background: var(--paper);
	color: var(--grafit);
	font-family: var(--font);
	font-size: var(--step-0);
	font-weight: 400;
	font-stretch: 100%;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	overflow-x: clip;
}

[hidden] {
	display: none !important;
}

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

a {
	color: inherit;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

a:hover {
	text-decoration-color: var(--signal);
}

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

::selection {
	background: var(--signal);
	color: var(--grafit);
}

h1,
h2,
h3 {
	text-wrap: balance;
}

p {
	text-wrap: pretty;
}

.mono {
	font-family: var(--mono);
	font-size: 0.92em;
}

.visually-hidden,
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

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

.skip-link:focus {
	top: 12px;
}

.site-main:focus {
	outline: none;
}

.container {
	width: min(100% - 2 * var(--gutter), var(--max));
	margin-inline: auto;
}

.container--text {
	width: min(100% - 2 * var(--gutter), 720px);
}

.container--wide {
	width: min(100% - 2 * var(--gutter), 1040px);
}

/* Buttons ----------------------------------------------------------------- */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5em;
	min-height: 48px;
	padding: 0.7em 1.25em;
	border: 1.5px solid transparent;
	border-radius: var(--radius);
	font: inherit;
	font-size: 1rem;
	font-weight: 640;
	font-stretch: 108%;
	line-height: 1.1;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}

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

.btn--primary {
	background: var(--signal);
	color: var(--grafit);
}

.btn--primary:hover {
	background: #E4490F;
}

.btn--ghost {
	background: transparent;
	color: var(--grafit);
	border-color: var(--grafit);
}

.btn--ghost:hover {
	background: var(--grafit);
	color: var(--paper);
}

.btn--small {
	min-height: 40px;
	padding: 0.5em 0.95em;
	font-size: 0.9375rem;
}

.btn[disabled] {
	opacity: 0.6;
	cursor: progress;
}

/* Header ------------------------------------------------------------------ */

.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(242, 243, 239, 0.94);
	-webkit-backdrop-filter: saturate(1.2) blur(8px);
	backdrop-filter: saturate(1.2) blur(8px);
	border-bottom: 1px solid transparent;
	transition: border-color 0.2s;
}

.admin-bar .site-header {
	top: 32px;
}

@media (max-width: 782px) {
	.admin-bar .site-header {
		top: 46px;
	}
}

@media (max-width: 600px) {
	.admin-bar .site-header {
		top: 0;
	}
}

.site-header.is-scrolled {
	border-bottom-color: var(--line);
}

.site-header__inner {
	width: min(100% - 2 * var(--gutter), var(--max));
	margin-inline: auto;
	min-height: var(--header-h);
	display: flex;
	align-items: center;
	gap: 24px;
}

.site-logo {
	display: block;
	flex: none;
	width: 150px;
	color: var(--grafit);
	line-height: 0;
}

.ks-logo {
	display: block;
	width: 100%;
	height: auto;
}

.site-nav {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 28px;
}

.site-nav__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 22px;
}

.site-nav__list a {
	display: block;
	padding: 6px 0;
	font-size: 0.975rem;
	font-weight: 540;
	text-decoration: none;
	border-bottom: 2px solid transparent;
}

.site-nav__list a:hover,
.site-nav__list a[aria-current="true"] {
	border-bottom-color: var(--signal);
}

.site-nav__tools {
	display: flex;
	align-items: center;
	gap: 12px;
}

.lang-switch {
	list-style: none;
	display: flex;
	gap: 2px;
	margin: 0;
	padding: 2px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
}

.lang-switch a {
	display: block;
	padding: 4px 8px;
	border-radius: 2px;
	color: var(--steel);
	font-size: 0.8125rem;
	font-weight: 650;
	text-decoration: none;
}

.lang-switch a:hover {
	color: var(--grafit);
}

.lang-switch a[aria-current="true"] {
	background: var(--grafit);
	color: var(--paper);
}

.lang-switch abbr {
	text-decoration: none;
}

.palette-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 5px 6px 5px 10px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: transparent;
	color: var(--steel);
	font: inherit;
	font-size: 0.875rem;
	cursor: pointer;
}

.palette-btn:hover {
	color: var(--grafit);
	border-color: var(--grafit);
}

.palette-btn kbd {
	padding: 1px 5px;
	border: 1px solid var(--line);
	border-radius: 3px;
	background: var(--sheet);
	color: var(--grafit);
	font-family: var(--mono);
	font-size: 0.75rem;
}

.nav-toggle {
	display: none;
}

@media (max-width: 1099px) {
	.palette-btn {
		display: none;
	}
}

@media (max-width: 959px) {
	.js .nav-toggle {
		display: inline-flex;
		align-items: center;
		gap: 10px;
		margin-left: auto;
		min-height: 44px;
		padding: 0 4px 0 12px;
		border: 0;
		background: transparent;
		color: var(--grafit);
		font: inherit;
		font-weight: 600;
		cursor: pointer;
	}

	.nav-toggle__bars,
	.nav-toggle__bars::before,
	.nav-toggle__bars::after {
		display: block;
		width: 20px;
		height: 2px;
		background: currentColor;
		transition: transform 0.2s var(--ease);
	}

	.nav-toggle__bars {
		position: relative;
	}

	.nav-toggle__bars::before,
	.nav-toggle__bars::after {
		content: "";
		position: absolute;
		left: 0;
	}

	.nav-toggle__bars::before {
		top: -6px;
	}

	.nav-toggle__bars::after {
		top: 6px;
	}

	.nav-toggle[aria-expanded="true"] .nav-toggle__bars {
		background: transparent;
	}

	.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before {
		transform: translateY(6px) rotate(45deg);
	}

	.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after {
		transform: translateY(-6px) rotate(-45deg);
	}

	.js .site-nav {
		position: fixed;
		top: var(--header-h);
		left: 0;
		right: 0;
		display: none;
		flex-direction: column;
		align-items: stretch;
		gap: 20px;
		max-height: calc(100dvh - var(--header-h));
		overflow: auto;
		padding: 8px var(--gutter) 28px;
		background: var(--paper);
		border-bottom: 1px solid var(--line);
	}

	.js .site-nav.is-open {
		display: flex;
	}

	.js .site-nav__list {
		flex-direction: column;
		gap: 0;
	}

	.js .site-nav__list a {
		padding: 14px 0;
		border-bottom: 1px solid var(--line-soft);
		font-size: 1.3rem;
		font-weight: 650;
		font-stretch: 112%;
	}

	.js .site-nav__tools {
		justify-content: space-between;
	}

	.no-js .site-header__inner {
		flex-wrap: wrap;
		padding: 12px 0;
	}

	.no-js .site-nav {
		width: 100%;
		flex-wrap: wrap;
		gap: 12px;
	}

	.no-js .site-nav__list {
		flex-wrap: wrap;
		gap: 4px 16px;
	}
}

/* Section scaffolding ----------------------------------------------------- */

.section {
	padding: clamp(64px, 9vw, 128px) 0;
}

.section--tight {
	padding-top: 0;
}

.section-head {
	max-width: 780px;
	margin-bottom: clamp(32px, 4vw, 56px);
}

.section-head--row {
	max-width: none;
	display: flex;
	flex-wrap: wrap;
	align-items: end;
	justify-content: space-between;
	gap: 16px 32px;
}

.section-title {
	margin: 0 0 0.35em;
	font-size: var(--step-4);
	font-weight: 790;
	font-stretch: 118%;
	letter-spacing: -0.022em;
	line-height: 1.02;
}

.section-lead {
	margin: 0;
	max-width: 52ch;
	color: var(--steel);
	font-size: var(--step-1);
	line-height: 1.5;
}

.link-strong {
	font-weight: 650;
	text-decoration-color: var(--signal);
	text-decoration-thickness: 2px;
}

/* Hero -------------------------------------------------------------------- */

.hero {
	padding: clamp(20px, 3vw, 40px) 0 clamp(48px, 7vw, 96px);
}

.hero__inner {
	width: min(100% - 2 * var(--gutter), var(--max));
	margin-inline: auto;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 16px;
}

.board {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 22px;
	height: 100%;
	padding: clamp(28px, 5vw, 64px) clamp(22px, 4.5vw, 64px);
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	background-color: var(--sheet);
	background-image:
		linear-gradient(var(--grid) 1px, transparent 1px),
		linear-gradient(90deg, var(--grid) 1px, transparent 1px);
	background-size: 24px 24px;
	background-position: -1px -1px;
}

.hero__title {
	position: relative;
	margin: 0;
	max-width: 15ch;
	font-size: var(--step-5);
	font-weight: 820;
	font-stretch: 120%;
	letter-spacing: -0.028em;
	line-height: 0.98;
}

.hero__lead {
	position: relative;
	margin: 0;
	max-width: 40ch;
	color: var(--grafit);
	font-size: var(--step-1);
	line-height: 1.5;
}

.hero__actions {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.hero__note {
	position: relative;
	margin: 0;
	color: var(--steel);
	font-size: 0.9375rem;
}

/* Build animation: hidden until built, with a CSS failsafe in case JS never runs. */
@media (prefers-reduced-motion: no-preference) {
	.js .board:not(.is-done) [data-build]:not(.is-built) {
		opacity: 0;
		transform: translateY(8px);
		animation: ks-failsafe 0s linear 3.5s forwards;
	}

	.js .board.is-running [data-build]:not(.is-built) {
		animation: none;
	}

	.board [data-build] {
		transition: opacity 0.5s var(--ease), transform 0.5s var(--ease), outline-color 0.6s;
	}
}

/* Technical-drawing annotations while the page is being built. */
.board [data-build] {
	outline: 1px dashed transparent;
	outline-offset: 8px;
}

.board.is-annotating [data-build].is-built {
	outline-color: rgba(184, 64, 15, 0.55);
}

.board [data-build]::before {
	content: "<" attr(data-tag) ">";
	position: absolute;
	top: -26px;
	left: -9px;
	padding: 0 5px;
	border: 1px solid currentColor;
	border-radius: 2px;
	background: var(--sheet);
	color: var(--signal-ink);
	font-family: var(--mono);
	font-size: 11px;
	font-weight: 400;
	font-stretch: 100%;
	letter-spacing: 0;
	line-height: 1.6;
	opacity: 0;
	transition: opacity 0.4s;
	pointer-events: none;
}

.board.is-annotating [data-build].is-built::before {
	opacity: 1;
}

.editor {
	display: flex;
	flex-direction: column;
	height: 100%;
	border-radius: var(--radius-lg);
	background: var(--grafit);
	color: var(--code-text);
	overflow: hidden;
}

.editor__bar {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 46px;
	padding: 8px 12px 8px 16px;
	border-bottom: 1px solid var(--grafit-3);
	color: var(--steel-dk);
	font-size: 0.8125rem;
}

.editor__dots {
	display: flex;
	gap: 6px;
}

.editor__dots i {
	display: block;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--grafit-3);
}

.editor__file {
	font-family: var(--mono);
}

.editor__replay {
	margin-left: auto;
	padding: 5px 10px;
	border: 1px solid var(--grafit-3);
	border-radius: var(--radius);
	background: transparent;
	color: var(--steel-dk);
	font: inherit;
	font-size: 0.8125rem;
	cursor: pointer;
}

.editor__replay:hover {
	color: var(--paper);
	border-color: var(--signal);
}

.editor__code {
	flex: 1;
	margin: 0;
	padding: 18px 16px 24px 0;
	overflow: auto;
	font-family: var(--mono);
	font-size: 13px;
	line-height: 1.8;
	white-space: pre;
	tab-size: 2;
	counter-reset: ln;
}

.editor__code .ln {
	position: relative;
	display: block;
	min-height: 1.8em;
	padding-left: 48px;
}

.editor__code .ln::before {
	content: counter(ln);
	counter-increment: ln;
	position: absolute;
	left: 0;
	width: 32px;
	text-align: right;
	color: #59616A;
}

.editor__code .ln.is-active {
	background: rgba(255, 255, 255, 0.045);
}

.editor__term {
	margin: 0;
	padding: 12px 16px 14px;
	border-top: 1px solid var(--grafit-3);
	color: var(--code-dim);
	font-family: var(--mono);
	font-size: 12.5px;
	line-height: 1.7;
	white-space: pre;
	min-height: calc(6 * 1.7em + 26px);
}

.term-ok {
	color: var(--code-tag);
}

.term-done {
	color: var(--code-str);
}

.caret {
	display: inline-block;
	width: 0.55em;
	height: 1.2em;
	margin-left: 1px;
	vertical-align: -0.25em;
	background: var(--signal);
	animation: ks-blink 1s steps(1) infinite;
}

.tk-p {
	color: var(--code-dim);
}

.tk-tag {
	color: var(--code-tag);
}

.tk-attr {
	color: var(--code-attr);
}

.tk-str {
	color: var(--code-str);
}

@media (min-width: 960px) {
	.hero__inner {
		grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
		align-items: stretch;
		min-height: min(640px, calc(100vh - var(--header-h) - 48px));
	}

	.hero__editor {
		order: -1;
	}

	.editor__code {
		font-size: 14px;
	}
}

@media (max-width: 959px) {
	.editor__code {
		max-height: 260px;
	}
}

/* Workshop ---------------------------------------------------------------- */

.workshop {
	background: var(--paper-2);
	border-top: 1px solid var(--line);
	border-bottom: 1px solid var(--line);
}

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

.tile {
	grid-column: span 12;
	display: flex;
	flex-direction: column;
	gap: 20px;
	min-width: 0;
	padding: clamp(20px, 2.2vw, 28px);
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	background: var(--sheet);
}

@media (min-width: 720px) {
	.tile {
		grid-column: span 6;
	}

	/* Large demos take the full width and use columns inside. Flow and
	   auto-split are too unequal side by side at this width, so they get a
	   row each until 1080 px. */
	.tile--trade,
	.tile--pc,
	.tile--flow,
	.tile--split,
	.tile--tr,
	.tile--bench,
	.tile--own {
		grid-column: span 12;
	}
}

/* Small demos stand in pairs of similar height (measured, see OPGAVE 14.4). */
@media (min-width: 1080px) {
	.tile--track {
		grid-column: span 7;
	}

	.tile--fifo {
		grid-column: span 5;
	}

	.tile--flow,
	.tile--split {
		grid-column: span 6;
	}
}

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

.tag {
	justify-self: start;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 2px 10px 2px 7px;
	border: 1px solid var(--line);
	border-radius: 3px 999px 999px 3px;
	background: var(--paper-2);
	color: var(--grafit);
	font-size: 0.75rem;
	font-weight: 620;
	line-height: 1.6;
}

.tag::before {
	content: "";
	width: 7px;
	height: 7px;
	border: 1.5px solid var(--grafit);
	border-radius: 50%;
	background: var(--sheet);
}

.tile__title {
	margin: 4px 0 0;
	font-size: var(--step-2);
	font-weight: 770;
	font-stretch: 114%;
	letter-spacing: -0.015em;
	line-height: 1.1;
}

.tile__text {
	margin: 0;
	max-width: 46ch;
	color: var(--steel);
	font-size: 1rem;
}

.demo {
	display: grid;
	gap: 14px;
	margin-top: auto;
}

.demo__controls {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.demo__status {
	min-height: 1.6em;
	margin: 0;
	font-size: 0.9375rem;
}

.meter {
	display: block;
	height: 10px;
	border-radius: 5px;
	background: var(--line-soft);
	overflow: hidden;
}

.meter > span {
	display: block;
	height: 100%;
	border-radius: 5px;
	background: var(--grafit);
	transition: width 0.5s var(--ease);
}

.tile--own {
	justify-content: space-between;
	border-color: var(--grafit);
	background: var(--grafit);
	color: var(--paper);
}

.tile--own .tile__title {
	margin: 0;
}

.tile--own .tile__text {
	color: var(--steel-dk);
}

.tile--own .btn {
	align-self: start;
}

.own__copy {
	display: grid;
	gap: 8px;
}

@media (min-width: 720px) {
	.tile--own {
		flex-direction: row;
		align-items: center;
		gap: 24px 48px;
	}

	.tile--own .btn {
		flex: none;
		align-self: center;
	}
}

/* Disabled demo buttons mean "not possible right now". */
.tile .btn[disabled] {
	cursor: not-allowed;
}

/* Demo: tracking */
.demo-track__order {
	display: flex;
	gap: 8px;
	margin: 0;
	color: var(--steel);
	font-size: 0.875rem;
}

.demo-track__order .mono {
	color: var(--grafit);
}

.demo-track__steps {
	list-style: none;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 8px;
	margin: 0;
	padding: 0;
}

.demo-track__bar {
	position: relative;
	display: block;
	height: 6px;
	margin-bottom: 10px;
	border-radius: 3px;
	background: var(--line-soft);
	overflow: hidden;
}

.demo-track__bar::after {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--signal);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.5s var(--ease);
}

.demo-track__steps .is-done .demo-track__bar::after {
	transform: scaleX(1);
}

.demo-track__label {
	display: block;
	color: var(--steel);
	font-size: 0.9375rem;
	font-weight: 600;
}

.demo-track__steps .is-done .demo-track__label {
	color: var(--grafit);
}

.demo-track__steps .is-current .demo-track__label::after {
	content: "";
	display: inline-block;
	width: 7px;
	height: 7px;
	margin-left: 6px;
	border-radius: 50%;
	background: var(--signal);
	vertical-align: 0.1em;
}

.demo-track__time {
	display: block;
	min-height: 1.5em;
	color: var(--steel);
	font-size: 0.75rem;
}

@media (max-width: 479px) {
	.demo-track__steps {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		row-gap: 14px;
	}
}

/* Demo: FIFO */
.demo-fifo__list {
	list-style: none;
	display: grid;
	gap: 12px;
	margin: 0;
	padding: 0;
}

.demo-fifo__list li {
	display: grid;
	grid-template-columns: minmax(6.5em, auto) minmax(0, 1fr) 4.2em;
	align-items: center;
	gap: 12px;
	font-size: 0.9375rem;
}

.demo-fifo__qty {
	text-align: right;
}

.demo-fifo__list .is-next .meter > span {
	background: var(--signal);
}

.demo-fifo__list .is-empty {
	color: var(--steel);
}

.demo-fifo__list .is-empty .demo-fifo__label {
	text-decoration: line-through;
}

/* Demo: integration flow */
.demo-flow__nodes {
	list-style: none;
	display: grid;
	margin: 0;
	padding: 0;
}

.demo-flow__nodes li {
	position: relative;
	display: grid;
	grid-template-columns: 16px minmax(0, 1fr) auto;
	column-gap: 14px;
	padding: 3px 0 7px;
	line-height: 1.4;
}

.demo-flow__nodes li:not(:last-child)::before {
	content: "";
	position: absolute;
	left: 7px;
	top: 23px;
	bottom: -3px;
	width: 2px;
	background: var(--line-soft);
	transition: background 0.3s;
}

.demo-flow__nodes li.is-passed::before {
	background: var(--signal);
}

.demo-flow__dot {
	position: relative;
	z-index: 1;
	grid-row: 1 / span 2;
	width: 16px;
	height: 16px;
	margin-top: 4px;
	border: 2px solid var(--line);
	border-radius: 50%;
	background: var(--sheet);
	transition: background 0.3s, border-color 0.3s, transform 0.3s var(--ease);
}

.demo-flow__nodes li.is-on .demo-flow__dot {
	border-color: var(--signal);
	background: var(--signal);
	transform: scale(1.1);
}

.demo-flow__system {
	font-weight: 650;
}

.demo-flow__action {
	grid-column: 2;
	color: var(--steel);
	font-size: 0.9375rem;
}

.demo-flow__time {
	grid-column: 3;
	grid-row: 1;
	color: var(--steel);
	font-size: 0.75rem;
}

/* Segmented control (configurator) */
.seg {
	display: flex;
	flex-wrap: wrap;
	gap: 2px;
	width: max-content;
	max-width: 100%;
	padding: 2px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--paper);
}

.seg label {
	position: relative;
}

.seg input {
	position: absolute;
	inset: 0;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.seg span {
	display: block;
	padding: 7px 12px;
	border-radius: 3px;
	color: var(--steel);
	font-size: 0.875rem;
	font-weight: 580;
	cursor: pointer;
}

.seg input:checked + span {
	background: var(--grafit);
	color: var(--paper);
}

.seg input:focus-visible + span {
	outline: 3px solid var(--signal);
	outline-offset: 1px;
}

.spec {
	display: grid;
	gap: 8px;
	margin: 0;
}

.spec div {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding-top: 8px;
	border-top: 1px solid var(--line-soft);
}

.spec dt {
	color: var(--steel);
	font-size: 0.875rem;
}

.spec dd {
	margin: 0;
	font-weight: 620;
	text-align: right;
}

/* Demo: auto-split */
.demo-split__limit {
	margin: 0;
	color: var(--steel);
	font-size: 0.875rem;
}

.demo-split__items {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
	padding: 0;
	transition: opacity 0.3s;
}

.demo-split__items li {
	padding: 3px 8px;
	border: 1px solid var(--line);
	border-radius: 3px;
	background: var(--paper);
	font-size: 0.875rem;
}

.demo-split__items .num {
	color: var(--steel);
	font-variant-numeric: tabular-nums;
}

.demo-split__items.is-packed li {
	border-style: dashed;
	background: transparent;
	color: var(--steel);
	text-decoration: line-through;
}

.demo-split__parcels {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 10px;
}

.demo-split__parcels:empty {
	display: none;
}

.parcel {
	position: relative;
	padding: 12px 12px 10px;
	border: 1.5px solid var(--grafit);
	border-radius: var(--radius);
	background: var(--sheet);
}

.parcel::before {
	content: "";
	position: absolute;
	top: -1.5px;
	left: calc(50% - 10px);
	width: 20px;
	height: 9px;
	background: var(--signal);
}

.parcel__head {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	font-size: 0.875rem;
	font-weight: 650;
}

.parcel__items {
	list-style: none;
	margin: 6px 0 8px;
	padding: 0;
	color: var(--steel);
	font-size: 0.8125rem;
	line-height: 1.5;
}

.parcel .meter {
	height: 6px;
}

.parcel.is-empty {
	border-style: dashed;
	border-color: var(--line);
	background: transparent;
	color: var(--steel);
}

.parcel.is-empty::before {
	background: var(--line);
}

.parcel.is-empty .parcel__items {
	visibility: hidden;
}

@media (prefers-reduced-motion: no-preference) {
	.parcel.is-filled {
		animation: ks-drop 0.4s var(--ease) both;
	}
}

/* Demo: trading robot */
.tile--trade {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 24px;
}

@media (min-width: 960px) {
	.tile--trade {
		grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
		gap: 36px;
	}
}

.trade__info {
	display: grid;
	align-content: start;
	gap: 18px;
	container-type: inline-size;
}

.trade__rules {
	margin: 0;
	padding: 0 0 0 18px;
	font-size: 0.9375rem;
	line-height: 1.5;
}

.trade__rules li {
	margin-bottom: 4px;
}

.trade__rules li::marker {
	color: var(--signal);
}

.switch {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-size: 0.9375rem;
	font-weight: 600;
	cursor: pointer;
}

.switch input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.switch span::before {
	content: "";
	display: inline-block;
	width: 34px;
	height: 20px;
	margin-right: 10px;
	border-radius: 10px;
	background: var(--line);
	vertical-align: -5px;
	box-shadow: inset 0 0 0 2px var(--line);
	transition: background 0.15s;
}

.switch span::after {
	content: "";
	position: absolute;
	left: 3px;
	top: 50%;
	width: 14px;
	height: 14px;
	margin-top: -7px;
	border-radius: 50%;
	background: var(--sheet);
	transition: transform 0.15s var(--ease);
}

.switch input:checked + span::before {
	background: var(--grafit);
	box-shadow: inset 0 0 0 2px var(--grafit);
}

.switch input:checked + span::after {
	transform: translateX(14px);
	background: var(--signal);
}

.switch input:focus-visible + span::before {
	outline: 3px solid var(--signal);
	outline-offset: 2px;
}

.trade__toggles {
	flex-direction: column;
	gap: 10px;
}

/* Five boxes in one row when there is room, otherwise 3 + 2 where both rows
   fill the full width (never 4 + 1). */
.trade__stats {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 8px;
	margin: 0;
}

.trade__stats > div {
	grid-column: span 2;
}

.trade__stats > div:nth-child(n+4) {
	grid-column: span 3;
}

@container (min-width: 430px) {
	.trade__stats {
		grid-template-columns: repeat(5, minmax(0, 1fr));
	}

	.trade__stats > div,
	.trade__stats > div:nth-child(n+4) {
		grid-column: auto;
	}
}

/* Boxes in a row share one height; the number sits at the bottom so all
   numbers line up, whether the label takes one or two lines. */
.trade__stats div {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 8px 10px 9px;
	border: 1px solid var(--line-soft);
	border-radius: var(--radius);
	background: var(--paper);
}

.trade__stats dt {
	color: var(--steel);
	font-size: 0.75rem;
	line-height: 1.3;
}

.trade__stats dd {
	margin: auto 0 0;
	font-size: 1.375rem;
	font-weight: 750;
	line-height: 1;
}

.num {
	font-variant-numeric: tabular-nums;
}

.trade__chart {
	display: grid;
	gap: 12px;
	min-width: 0;
}

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

.trade__legend {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 4px 16px;
	margin: 0;
	padding: 0;
	color: var(--steel);
	font-size: 0.8125rem;
}

.lg::before {
	content: "";
	display: inline-block;
	margin-right: 6px;
	vertical-align: 2px;
}

.lg--0::before {
	width: 16px;
	height: 2px;
	background: var(--grafit);
}

.lg--1::before {
	width: 16px;
	height: 0;
	border-top: 2px dashed var(--steel-dk);
}

.lg--2::before {
	width: 0;
	height: 0;
	border-left: 5px solid transparent;
	border-right: 5px solid transparent;
	border-bottom: 9px solid var(--signal);
	vertical-align: 0;
}

.lg--3::before {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--grafit);
	vertical-align: 0;
}

.trade__day {
	color: var(--steel);
	font-size: 0.875rem;
}

.trade__svg {
	display: block;
	width: 100%;
	height: clamp(220px, 28vw, 320px);
	border: 1px solid var(--line-soft);
	border-radius: var(--radius);
	background-color: var(--sheet);
	background-image:
		linear-gradient(var(--grid) 1px, transparent 1px),
		linear-gradient(90deg, var(--grid) 1px, transparent 1px);
	background-size: 24px 24px;
}

.tc-grid {
	stroke: var(--line-soft);
	stroke-width: 1;
	vector-effect: non-scaling-stroke;
}

.tc-rsi-band {
	fill: rgba(30, 34, 38, 0.04);
}

.tc-rsi-line {
	stroke: var(--line);
	stroke-width: 1;
	stroke-dasharray: 3 3;
	vector-effect: non-scaling-stroke;
}

.tc-label {
	fill: var(--steel);
	font-family: var(--mono);
	font-size: 10px;
}

.tc-price,
.tc-sma,
.tc-rsi {
	fill: none;
	stroke-linejoin: round;
	vector-effect: non-scaling-stroke;
}

.tc-price {
	stroke: var(--grafit);
	stroke-width: 2;
}

.tc-sma {
	stroke: var(--steel-dk);
	stroke-width: 1.5;
	stroke-dasharray: 5 4;
}

.tc-rsi {
	stroke: var(--steel);
	stroke-width: 1.25;
}

.tc-cursor {
	stroke: var(--signal);
	stroke-width: 1;
	vector-effect: non-scaling-stroke;
}

.tc-buy {
	fill: var(--signal);
}

.tc-sell {
	fill: var(--grafit);
}

.tc-loss {
	fill: var(--sheet);
	stroke: var(--signal-ink);
	stroke-width: 2;
	vector-effect: non-scaling-stroke;
}

.tc-block {
	stroke: var(--steel-dk);
	stroke-width: 2;
	vector-effect: non-scaling-stroke;
}

.trade__log {
	list-style: none;
	display: grid;
	gap: 4px;
	min-height: calc(5 * 1.6em);
	margin: 0;
	padding: 0;
	font-size: 0.875rem;
	line-height: 1.6;
}

.trade__log .ev::before {
	content: "";
	display: inline-block;
	width: 8px;
	height: 8px;
	margin-right: 8px;
	border-radius: 50%;
	background: var(--line);
	vertical-align: 1px;
}

.trade__log .ev--buy::before {
	background: var(--signal);
}

.trade__log .ev--tp::before {
	background: var(--grafit);
}

.trade__log .ev--stop::before,
.trade__log .ev--time::before {
	background: var(--sheet);
	box-shadow: inset 0 0 0 2px var(--signal-ink);
}

.trade__log .is-empty {
	color: var(--steel);
}

.demo__note {
	margin: 0;
	color: var(--steel);
	font-size: 0.8125rem;
}

/* Shared: tables, badges and number boxes for the larger demos */
.pc-table-wrap {
	max-width: 100%;
	overflow-x: auto;
}

.pc-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.8125rem;
	line-height: 1.35;
}

.pc-table caption {
	margin-bottom: 6px;
	font-size: 0.875rem;
	font-weight: 700;
	text-align: left;
}

.pc-table th {
	padding: 6px 8px;
	border-bottom: 1px solid var(--line);
	color: var(--steel);
	font-size: 0.75rem;
	font-weight: 620;
	text-align: left;
	vertical-align: bottom;
}

.pc-table td {
	padding: 7px 8px;
	border-bottom: 1px solid var(--line-soft);
	vertical-align: top;
	overflow-wrap: anywhere;
	hyphens: auto;
}

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

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

.pc-table .num {
	font-variant-numeric: tabular-nums;
	text-align: right;
	white-space: nowrap;
}

.pc-table td.stock {
	white-space: normal;
}

.pc-table .mono {
	font-family: var(--mono);
	font-size: 0.75rem;
	white-space: nowrap;
}

.pc-table tfoot th,
.pc-table tfoot td {
	padding-top: 10px;
	border-bottom: 0;
	color: var(--grafit);
	font-size: 0.9375rem;
	font-weight: 750;
}

.badge {
	display: inline-block;
	margin-left: 2px;
	padding: 1px 6px;
	border-radius: 3px;
	background: var(--signal-wash);
	color: var(--signal-ink);
	font-size: 0.6875rem;
	font-weight: 700;
	line-height: 1.4;
	white-space: nowrap;
}

.is-low {
	color: var(--signal-ink);
	font-weight: 700;
}

@media (prefers-reduced-motion: no-preference) {
	.pc-table tr.is-changed td {
		animation: ks-flash 1.2s var(--ease);
	}
}

@keyframes ks-flash {
	from {
		background: var(--signal-wash);
	}

	to {
		background: transparent;
	}
}

/* Number boxes: boxes in a row share one height and the number sits at the
   bottom, so all numbers line up whatever the label length. */
.kpis {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
	margin: 0;
}

.kpis > div {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 8px 10px 9px;
	border: 1px solid var(--line-soft);
	border-radius: var(--radius);
	background: var(--paper);
}

.kpis dt {
	color: var(--steel);
	font-size: 0.75rem;
	line-height: 1.3;
}

.kpis dd {
	margin: auto 0 0;
	font-size: 1.125rem;
	font-weight: 750;
	line-height: 1;
	white-space: nowrap;
}

/* Demo: computer configurator */
.tile--pc {
	container-type: inline-size;
}

.pc {
	display: grid;
	gap: 24px;
}

@container (min-width: 860px) {
	.pc {
		grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
		gap: 28px 40px;
	}

	.pc__pick {
		grid-column: 1 / -1;
	}
}

/* Narrow screens: tighter cells, and the back-order badge goes under the
   number so the bill of materials fits without sideways scrolling. */
@container (max-width: 420px) {
	.pc-table th,
	.pc-table td {
		padding-right: 4px;
		padding-left: 4px;
	}

	.pc-table td.stock .badge {
		display: block;
		margin: 2px 0 0;
		white-space: normal;
		text-align: center;
	}

	.pc-table tfoot th,
	.pc-table tfoot td {
		font-size: 0.875rem;
	}
}

.pc__info,
.pc__build {
	display: grid;
	align-content: start;
	gap: 18px;
	min-width: 0;
}

.pc__steps {
	display: grid;
	gap: 12px;
	margin: 0;
}

.pc__step {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.pc__step legend {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 6px;
	padding: 0;
	color: var(--grafit);
	font-size: 0.8125rem;
	font-weight: 650;
}

.pc__n {
	display: inline-grid;
	place-items: center;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--grafit);
	color: var(--paper);
	font-size: 0.6875rem;
	font-weight: 700;
}

.seg label.is-disabled span {
	color: var(--steel-dk);
	text-decoration: line-through;
	cursor: not-allowed;
}

.seg input:disabled {
	cursor: not-allowed;
}

.pc__fit {
	margin: 0;
	color: var(--signal-ink);
	font-size: 0.875rem;
}

.pc__fit:empty {
	display: none;
}

.pc__top {
	display: grid;
	align-items: center;
	gap: 16px;
}

@container (min-width: 600px) {
	.pc__top {
		grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
	}
}

.pc-svg {
	display: block;
	width: 100%;
	max-width: 320px;
	height: auto;
	margin: 0 auto;
}

.pc-svg__case {
	fill: var(--sheet);
	stroke: var(--grafit);
	stroke-width: 2.5;
}

.pc-svg__foot,
.pc-svg__ram,
.pc-svg__psu {
	fill: var(--grafit);
}

.pc-svg__case.is-bad,
.pc-svg__psu.is-bad {
	stroke: var(--signal);
	stroke-width: 3;
}

.pc-svg__psu.is-bad {
	fill: var(--signal-ink);
}

.pc-svg__mb {
	fill: var(--paper-2);
	stroke: var(--line);
}

.pc-svg__cpu {
	fill: var(--grafit-3);
}

.pc-svg__fan,
.pc-svg__gfan {
	fill: none;
	stroke: var(--steel-dk);
	stroke-width: 1.5;
}

.pc-svg__gpu {
	fill: var(--grafit-2);
}

.pc-svg__ssd {
	fill: var(--steel);
}

.pc-svg__label {
	fill: var(--paper);
	font-family: var(--mono);
	font-size: 10px;
}

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

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

.pc__mhead {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	font-size: 0.875rem;
	font-weight: 650;
}

.pc__weak {
	padding: 1px 8px;
	border-radius: 999px;
	background: var(--signal-wash);
	color: var(--signal-ink);
	font-size: 0.6875rem;
	font-weight: 700;
	white-space: nowrap;
}

.pc__mval {
	color: var(--steel);
	font-size: 0.8125rem;
}

.pc__meter.is-bad .meter > span {
	background: var(--signal);
}

.pc__status {
	margin: 0;
	font-size: 0.9375rem;
	font-weight: 650;
}

.pc__status.is-bad {
	color: var(--signal-ink);
}

.pc__variants {
	margin: 0;
	padding: 10px 12px;
	border: 1px dashed var(--line);
	border-radius: var(--radius);
	color: var(--steel);
	font-size: 0.8125rem;
}

.pc__pick {
	display: grid;
	gap: 10px;
	padding: 16px 18px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--paper);
}

.pc__h {
	margin: 0;
	font-size: 0.875rem;
	font-weight: 700;
}

.pc__empty {
	margin: 0;
	color: var(--steel);
	font-size: 0.875rem;
}

.pick__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 10px;
}

.pick__nr {
	color: var(--signal-ink);
}

.pick__sum {
	margin: 0;
	color: var(--steel);
	font-size: 0.8125rem;
}

.pick__arrow {
	color: var(--steel-dk);
}

.pc__pick.is-cancelled .pick {
	opacity: 0.5;
	text-decoration: line-through;
}

/* Demo: time registration */
.tile--tr {
	container-type: inline-size;
}

.tr {
	display: grid;
	gap: 24px;
}

@container (min-width: 900px) {
	.tr {
		grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
		gap: 28px 40px;
	}

	.tr-pay {
		grid-column: 1 / -1;
	}
}

@container (min-width: 520px) {
	.tr .kpis {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.tr__left,
.tr__right {
	display: grid;
	align-content: start;
	gap: 18px;
	min-width: 0;
}

.tr__h {
	margin: 0;
	font-size: 1rem;
	font-weight: 750;
}

.tr__rules {
	margin: 0;
	padding: 0 0 0 18px;
	font-size: 0.9375rem;
	line-height: 1.5;
}

.tr__rules li {
	margin-bottom: 4px;
}

.tr__rules li::marker {
	color: var(--signal);
}

/* The terminal by the door: a dark tablet. */
.tr-term {
	display: grid;
	gap: 14px;
	padding: 18px;
	border-radius: 14px;
	background: var(--grafit);
	box-shadow: inset 0 0 0 6px var(--grafit-2);
	color: var(--paper);
}

.tr-term__top {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 4px 12px;
}

.tr-term__clock {
	font-size: clamp(2rem, 3.4vw, 2.6rem);
	letter-spacing: 0.02em;
	line-height: 1;
}

.tr-term__date,
.tr-term__demo,
.tr-term__label {
	color: var(--steel-dk);
	font-size: 0.8125rem;
}

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

.tr-person {
	position: relative;
	display: grid;
	justify-items: center;
	gap: 2px;
	min-width: 0;
	padding: 10px 6px;
	border: 1px solid var(--grafit-3);
	border-radius: 10px;
	background: var(--grafit-2);
	color: var(--paper);
	font: inherit;
	cursor: pointer;
	transition: border-color 0.15s, background-color 0.15s;
}

.tr-person:hover {
	border-color: var(--steel);
}

.tr-person[aria-pressed="true"] {
	border-color: var(--signal);
	background: var(--grafit-3);
}

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

.tr-person__av {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--paper);
	color: var(--grafit);
	font-weight: 750;
}

.tr-person__name {
	font-size: 0.875rem;
	font-weight: 650;
}

.tr-person__role {
	color: var(--code-attr);
	font-size: 0.75rem;
}

.tr-person__dot {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	box-shadow: inset 0 0 0 1px var(--steel);
}

.tr-person.is-in .tr-person__dot {
	background: var(--signal);
	box-shadow: none;
}

.tr-term__state {
	margin: 0;
	font-size: 0.9375rem;
	font-weight: 600;
}

.tr-term__state.is-in {
	color: var(--code-tag);
}

.tr-day {
	position: relative;
	height: 34px;
}

.tr-day::before {
	content: "";
	position: absolute;
	top: 4px;
	right: 0;
	left: 0;
	height: 12px;
	border-radius: 6px;
	background: var(--grafit-3);
}

.tr-day__seg {
	position: absolute;
	top: 4px;
	height: 12px;
	border-radius: 6px;
	background: var(--paper);
}

.tr-day__seg.is-running {
	background: var(--signal);
}

.tr-day__now {
	position: absolute;
	top: 0;
	width: 2px;
	height: 20px;
	margin-left: -1px;
	background: var(--code-tag);
}

.tr-day__ticks {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	display: flex;
	justify-content: space-between;
	color: var(--steel-dk);
	font-family: var(--mono);
	font-size: 0.625rem;
}

.tr-term .demo__controls {
	align-items: center;
}

.tr-btn {
	border-color: var(--grafit-3);
	background: var(--grafit-2);
	color: var(--paper);
}

.tr-btn:hover {
	border-color: var(--steel);
}

.tr-btn[aria-pressed="true"] {
	border-color: var(--signal);
	background: var(--signal);
	color: var(--grafit);
}

/* Month overview */
.tr-month__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 4px 12px;
}

.tr-month__period,
.tr-hint {
	margin: 0;
	color: var(--steel);
	font-size: 0.8125rem;
}

.tr-cal {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 4px;
}

.tr-cal__wd {
	padding-bottom: 2px;
	color: var(--steel);
	font-size: 0.6875rem;
	font-weight: 620;
	text-align: center;
	text-transform: capitalize;
}

.tr-cal__d {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	min-width: 0;
	min-height: 46px;
	padding: 4px 6px;
	border: 1px solid transparent;
	border-radius: 4px;
	background: var(--paper-2);
	color: var(--grafit);
	font: inherit;
	text-align: left;
}

.tr-cal__n {
	color: var(--steel);
	font-size: 0.6875rem;
	line-height: 1.2;
}

.tr-cal__v {
	overflow: hidden;
	font-size: 0.75rem;
	font-weight: 650;
	line-height: 1.2;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.tr-cal__d.is-vacation,
.tr-legend .is-vacation .tr-legend__sw {
	background: #D5E5E2;
}

.tr-cal__d.is-toil,
.tr-legend .is-toil .tr-legend__sw {
	background: #E2DEEC;
}

.tr-cal__d.is-sick,
.tr-legend .is-sick .tr-legend__sw {
	background: #F1E3C6;
}

.tr-cal__d.is-missing,
.tr-legend .is-missing .tr-legend__sw {
	border: 1px dashed var(--signal-ink);
	background: var(--signal-wash);
}

.tr-cal__d.is-missing {
	color: var(--signal-ink);
	cursor: pointer;
}

.tr-cal__d.is-missing:hover {
	background: #F8D5C6;
}

.tr-cal__d.is-missing:focus-visible {
	outline: 3px solid var(--signal);
	outline-offset: 1px;
}

.tr-cal__d.is-weekend,
.tr-legend .is-weekend .tr-legend__sw {
	border: 1px solid var(--line-soft);
	background: repeating-linear-gradient(135deg, transparent 0 5px, var(--line-soft) 5px 6px);
}

.tr-cal__d.is-future {
	border: 1px dashed var(--line-soft);
	background: transparent;
}

.tr-cal__d.is-open,
.tr-cal__d.is-running {
	background: var(--sheet);
}

.tr-cal__d.is-today {
	border: 2px solid var(--grafit);
}

.tr-cal__d.is-running .tr-cal__v {
	color: var(--signal-ink);
}

@container (max-width: 560px) {
	.tr-cal__v--type {
		display: none;
	}
}

.tr-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 14px;
	margin: 0;
	padding: 0;
	color: var(--steel);
	font-size: 0.75rem;
	list-style: none;
}

.tr-legend li {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.tr-legend__sw {
	width: 12px;
	height: 12px;
	border-radius: 3px;
	background: var(--paper-2);
}

/* Payroll */
.tr-pay {
	display: grid;
	gap: 18px;
	padding-top: 22px;
	border-top: 1px solid var(--line);
}

@container (min-width: 760px) {
	.tr-pay {
		grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
		align-items: start;
		gap: 20px 40px;
	}
}

.tr-pay__checks,
.tr-pay__lines {
	display: grid;
	align-content: start;
	gap: 12px;
	min-width: 0;
}

.tr-check {
	position: relative;
	margin: 0;
	padding-left: 28px;
	font-size: 0.9375rem;
	font-weight: 600;
}

.tr-check::before {
	content: "";
	position: absolute;
	top: 0.1em;
	left: 0;
	display: grid;
	place-items: center;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--line-soft);
	font-size: 0.75rem;
	font-weight: 800;
}

.tr-check.is-ok::before {
	content: "\2713";
	background: var(--grafit);
	color: var(--paper);
}

.tr-check.is-bad {
	color: var(--signal-ink);
}

.tr-check.is-bad::before {
	content: "!";
	background: var(--signal);
	color: var(--grafit);
}

.demo__status.is-ok {
	color: var(--grafit);
	font-weight: 650;
}

.tr-lines.is-sent tbody td {
	color: var(--steel);
}

/* Narrow screens: one card per employee instead of a wide table. */
@container (max-width: 600px) {
	.tr-lines thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
	}

	.tr-lines,
	.tr-lines tbody {
		display: block;
	}

	.tr-lines tr {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 4px 16px;
		padding: 10px 0;
		border-bottom: 1px solid var(--line-soft);
	}

	.pc-table.tr-lines td {
		display: flex;
		justify-content: space-between;
		gap: 8px;
		padding: 0;
		border: 0;
	}

	.pc-table.tr-lines td:first-child {
		grid-column: 1 / -1;
		font-weight: 700;
	}

	.tr-lines td[data-label]::before {
		content: attr(data-label);
		color: var(--steel);
		font-size: 0.75rem;
		text-align: left;
	}
}

/* Demo: test bench (wind turbine, side view) */
.tile--bench {
	container-type: inline-size;
}

.wt {
	display: grid;
	gap: 24px;
}

@container (min-width: 820px) {
	.wt {
		grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
		gap: 28px 40px;
	}
}

.wt__fig {
	display: flex;
	min-width: 0;
}

.wt-svg {
	display: block;
	width: 100%;
	height: auto;
	border: 1px solid var(--line-soft);
	border-radius: var(--radius);
	background: linear-gradient(var(--sheet), var(--paper));
}

.wt__side {
	display: grid;
	align-content: start;
	gap: 16px;
	min-width: 0;
}

.wt-svg__ground {
	fill: var(--paper-2);
}

.wt-svg__tower {
	fill: #E9ECE8;
	stroke: var(--grafit);
	stroke-width: 1.5;
}

.wt-svg__nacelle,
.wt-svg__hub {
	fill: var(--sheet);
	stroke: var(--grafit);
	stroke-width: 1.5;
}

.wt-svg__blade,
.wt-svg__load {
	fill: #EEF0EC;
	stroke: var(--grafit);
	stroke-width: 1.3;
}

.wt-svg__blade--back {
	opacity: 0.55;
}

.wt-svg__rope {
	stroke: var(--grafit);
	stroke-width: 1.2;
}

.tile--bench.is-bad .wt-svg__load {
	fill: var(--signal-wash);
	stroke: var(--signal-ink);
}

.wt-svg__dim {
	stroke: var(--signal-ink);
	stroke-width: 1;
	stroke-dasharray: 3 2;
}

.wt-svg__dimtext,
.wt-svg__wind text {
	fill: var(--signal-ink);
	font-family: var(--mono);
	font-size: 10px;
}

.wt-svg__wind text {
	fill: var(--steel);
}

.wt-svg__dimtext {
	paint-order: stroke;
	stroke: var(--sheet);
	stroke-width: 3px;
	stroke-linejoin: round;
}

.wt-svg__wind path {
	fill: none;
	stroke: var(--steel-dk);
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.demo-bench__controls {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 12px 20px;
}

.range {
	display: grid;
	gap: 4px;
	font-size: 0.875rem;
	font-weight: 600;
}

.range output {
	margin-left: 4px;
	color: var(--steel);
	font-weight: 400;
}

.range input[type="range"] {
	width: 100%;
	accent-color: var(--signal);
}

[data-bench-status].is-bad {
	color: var(--signal-ink);
}

.bench-matrix {
	display: grid;
	gap: 4px;
}

.bench-matrix__row {
	display: grid;
	grid-template-columns: 3em repeat(21, minmax(0, 1fr));
	align-items: center;
	gap: 3px;
}

.bench-matrix__label {
	color: var(--steel);
	font-size: 0.75rem;
}

.bench-matrix__cell {
	height: 14px;
	border-radius: 2px;
	background: var(--line-soft);
	transition: background 0.2s;
}

.bench-matrix__cell.is-ok {
	background: var(--grafit);
}

.bench-matrix__cell.is-bad {
	background: var(--signal);
}

.bench-matrix__axis {
	display: flex;
	justify-content: space-between;
	margin-left: calc(3em + 3px);
	color: var(--steel);
	font-size: 0.75rem;
}

/* Services ---------------------------------------------------------------- */

.services__list {
	list-style: none;
	margin: 0;
	padding: 0;
	border-top: 1.5px solid var(--grafit);
}

.service {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 4fr) minmax(0, 3fr);
	align-items: baseline;
	gap: 8px clamp(16px, 3vw, 40px);
	padding: clamp(20px, 3vw, 30px) 0;
	border-bottom: 1px solid var(--line);
}

.service__title {
	margin: 0;
	font-size: var(--step-3);
	font-weight: 770;
	font-stretch: 118%;
	letter-spacing: -0.02em;
	line-height: 1.05;
}

.service__text {
	margin: 0;
}

.service__tags {
	list-style: none;
	display: grid;
	gap: 2px;
	margin: 0;
	padding: 0;
	color: var(--steel);
	font-size: 0.9375rem;
	line-height: 1.45;
}

@media (max-width: 859px) {
	.service__tags {
		display: flex;
		flex-wrap: wrap;
		gap: 2px 14px;
	}
}

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

/* Process ----------------------------------------------------------------- */

.process {
	border-bottom: 1px solid var(--line);
}

.process__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 32px;
}

.process__steps {
	list-style: none;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 56px;
	margin: 0;
	padding: 0;
}

.step {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 20px;
	min-width: 0;
}

.step__no {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	margin-bottom: 14px;
	border: 1.5px solid var(--grafit);
	border-radius: 50%;
	font-size: 0.9375rem;
	font-weight: 720;
	transition: background 0.3s, border-color 0.3s;
}

.step__title {
	margin: 0 0 8px;
	font-size: var(--step-3);
	font-weight: 770;
	font-stretch: 118%;
	letter-spacing: -0.02em;
	line-height: 1.05;
}

.step__text {
	margin: 0;
	max-width: 44ch;
	color: var(--steel);
	font-size: 1.125rem;
}

.stage {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 260px;
	margin: 0;
	padding: clamp(20px, 3vw, 36px);
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	background-color: var(--sheet);
	background-image:
		linear-gradient(var(--grid) 1px, transparent 1px),
		linear-gradient(90deg, var(--grid) 1px, transparent 1px);
	background-size: 24px 24px;
}

.process__stage {
	display: none;
}

@media (min-width: 1000px) {
	.js .process.is-sticky .process__layout {
		grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
		gap: clamp(40px, 6vw, 96px);
	}

	.js .process.is-sticky .process__steps {
		gap: 0;
	}

	.js .process.is-sticky .step {
		min-height: 64vh;
		align-content: center;
	}

	.js .process.is-sticky .step:first-child {
		min-height: 50vh;
		align-content: start;
	}

	.js .process.is-sticky .step__fig {
		display: none;
	}

	.js .process.is-sticky .step.is-active .step__no {
		border-color: var(--signal);
		background: var(--signal);
	}

	.js .process.is-sticky .process__stage {
		position: sticky;
		top: calc(var(--header-h) + 32px);
		display: grid;
		height: min(540px, calc(100vh - var(--header-h) - 64px));
	}

	.process__stage .stage {
		grid-area: 1 / 1;
		min-height: 0;
		height: 100%;
		opacity: 0;
		visibility: hidden;
		transform: translateY(12px);
		transition: opacity 0.45s var(--ease), transform 0.45s var(--ease), visibility 0s 0.45s;
	}

	.process__stage .stage.is-active {
		opacity: 1;
		visibility: visible;
		transform: none;
		transition: opacity 0.45s var(--ease), transform 0.45s var(--ease), visibility 0s;
	}
}

.stage-idea {
	display: grid;
	gap: 20px;
	width: 100%;
	max-width: 520px;
}

.stage-idea__note {
	margin: 0;
	padding: 18px 20px;
	border: 1px solid var(--line);
	background: var(--paper);
	font-size: 1.25rem;
	font-weight: 560;
	line-height: 1.35;
	transform: rotate(-1.5deg);
}

.stage-idea__boxes {
	display: grid;
	grid-template-columns: 2fr 1fr 1fr;
	gap: 10px;
}

.stage-idea__boxes span {
	height: 70px;
	border: 1.5px dashed var(--steel-dk);
	border-radius: var(--radius);
}

.stage-sketch {
	display: grid;
	gap: 12px;
	width: 100%;
	max-width: 520px;
}

.w {
	display: block;
	border: 1.5px dashed var(--steel);
	border-radius: 3px;
}

.w--bar {
	height: 28px;
}

.w--block {
	height: 90px;
}

.w--line {
	height: 12px;
	border-style: solid;
	border-color: var(--line);
	background: var(--paper-2);
}

.w--short {
	width: 60%;
}

.w--steps {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 6px;
	border: 0;
}

.w--steps i {
	height: 8px;
	border: 1.5px dashed var(--steel);
	border-radius: 4px;
}

.w--btn {
	width: 120px;
	height: 34px;
}

.stage-design {
	display: grid;
	gap: 14px;
	width: 100%;
	max-width: 520px;
	padding: 22px;
	border: 1px solid var(--line);
	border-radius: 6px;
	background: var(--paper);
}

.stage-design__head {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
}

.stage-design__head strong {
	font-size: 1.25rem;
	font-weight: 770;
	font-stretch: 112%;
}

.stage-design__head .mono {
	color: var(--steel);
	font-size: 0.8125rem;
}

.stage-design__bars,
.stage-design__labels {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 6px;
}

.stage-design__bars i {
	height: 6px;
	border-radius: 3px;
	background: var(--line-soft);
}

.stage-design__bars i.on {
	background: var(--signal);
}

.stage-design__labels {
	color: var(--steel);
	font-size: 0.75rem;
}

.stage-design__btn {
	justify-self: start;
	padding: 8px 14px;
	border-radius: var(--radius);
	background: var(--signal);
	color: var(--grafit);
	font-size: 0.875rem;
	font-weight: 650;
}

.stage-code {
	width: 100%;
	margin: 0;
	padding: 22px;
	border-radius: 6px;
	background: var(--grafit);
	color: var(--code-text);
	font-size: 13px;
	line-height: 1.75;
	white-space: pre;
	overflow: auto;
}

.stage-code .c {
	color: var(--code-dim);
}

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

.stage-code .s {
	color: var(--code-str);
}

.stage-live {
	display: grid;
	gap: 14px;
	width: 100%;
	max-width: 520px;
}

.stage-live__badge {
	justify-self: start;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 4px 12px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--paper);
	font-weight: 650;
}

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

@media (prefers-reduced-motion: no-preference) {
	.stage.is-active .pulse,
	.step__fig .pulse {
		animation: ks-pulse 2s infinite;
	}
}

.stage-live__log {
	list-style: none;
	margin: 0;
	padding: 14px 16px;
	border-radius: 6px;
	background: var(--grafit);
	color: var(--code-text);
	font-size: 13px;
	line-height: 1.9;
}

.stage-live__log .t {
	color: var(--code-dim);
}

/* About ------------------------------------------------------------------- */

.about__grid {
	display: grid;
	grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
	align-items: start;
	gap: clamp(32px, 6vw, 96px);
}

.about__copy p {
	max-width: 36em;
	margin: 0 0 1em;
	font-size: var(--step-1);
	line-height: 1.55;
}

.sheet {
	margin: 0;
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	background: var(--sheet);
}

.sheet__row {
	display: grid;
	grid-template-columns: 8.5em minmax(0, 1fr);
	gap: 16px;
	padding: 14px 20px;
	border-bottom: 1px solid var(--line-soft);
}

.sheet__row:last-child {
	border-bottom: 0;
}

.sheet dt {
	padding-top: 2px;
	color: var(--steel);
	font-size: 0.875rem;
}

.sheet dd {
	margin: 0;
	font-weight: 580;
	overflow-wrap: anywhere;
}

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

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

@media (max-width: 420px) {
	.sheet__row {
		grid-template-columns: minmax(0, 1fr);
		gap: 2px;
	}
}

/* Posts ------------------------------------------------------------------- */

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

.post-list {
	list-style: none;
	margin: 0;
	padding: 0;
	border-top: 1.5px solid var(--grafit);
}

.post-row {
	display: grid;
	grid-template-columns: 8em minmax(0, 1fr);
	gap: 24px;
	padding: 22px 0;
	border-bottom: 1px solid var(--line);
}

.post-row__date {
	padding-top: 6px;
	color: var(--steel);
	font-size: 0.875rem;
}

.post-row__title {
	margin: 0 0 6px;
	font-size: var(--step-2);
	font-weight: 730;
	font-stretch: 110%;
	letter-spacing: -0.01em;
	line-height: 1.15;
}

.post-row__title a {
	text-decoration: none;
}

.post-row__title a:hover {
	text-decoration: underline;
	text-decoration-color: var(--signal);
	text-decoration-thickness: 2px;
}

.post-row__excerpt {
	margin: 0;
	max-width: 70ch;
	color: var(--steel);
}

@media (max-width: 599px) {
	.post-row {
		grid-template-columns: minmax(0, 1fr);
		gap: 4px;
	}
}

/* Guide (work order) ------------------------------------------------------ */

.guide {
	background: var(--grafit);
	color: var(--paper);
}

.guide .section-lead,
.guide__alt {
	color: var(--steel-dk);
}

.guide__alt {
	margin: 24px 0 0;
	font-size: 0.9375rem;
}

.guide__alt a {
	color: var(--paper);
}

.guide__grid {
	display: grid;
	grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
	align-items: start;
	gap: clamp(32px, 5vw, 80px);
}

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

.slip {
	position: relative;
	padding: clamp(24px, 3vw, 40px) clamp(18px, 3vw, 40px) clamp(20px, 3vw, 32px);
	border-radius: var(--radius-lg);
	background: var(--sheet);
	color: var(--grafit);
}

/* Tear-off notches along the top edge. */
.slip::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 7px;
	background: radial-gradient(circle at 8px 0, var(--grafit) 5px, transparent 5.5px) 0 0 / 16px 7px repeat-x;
}

.slip__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 6px 16px;
	margin-bottom: 18px;
	padding-bottom: 14px;
	border-bottom: 1.5px solid var(--grafit);
}

.slip__title {
	font-size: var(--step-2);
	font-weight: 800;
	font-stretch: 122%;
	letter-spacing: -0.015em;
}

.slip__nr {
	color: var(--steel);
	font-size: 0.875rem;
}

.slip__nr .mono {
	color: var(--grafit);
}

.slip__summary {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0 28px;
	margin: 0 0 24px;
}

.slip__summary div {
	display: grid;
	grid-template-columns: 6.5em minmax(0, 1fr);
	gap: 8px;
	padding: 7px 0;
	border-bottom: 1px dotted var(--line);
	font-size: 0.875rem;
}

.slip__summary dt {
	color: var(--steel);
}

.slip__summary dd {
	min-height: 1.4em;
	margin: 0;
	font-weight: 600;
	overflow-wrap: anywhere;
}

.slip__summary dd.is-empty {
	color: var(--steel);
	font-weight: 400;
}

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

.guide-progress {
	list-style: none;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 6px;
	margin: 0 0 24px;
	padding: 0;
	counter-reset: gp;
}

.guide-progress li {
	padding-top: 8px;
	border-top: 4px solid var(--line-soft);
	color: var(--steel);
	font-size: 0.8125rem;
	counter-increment: gp;
	transition: border-color 0.3s;
}

.guide-progress li::before {
	content: counter(gp) " ";
	font-family: var(--mono);
}

.guide-progress li.is-done {
	border-top-color: var(--grafit);
	color: var(--grafit);
}

.guide-progress li.is-current {
	border-top-color: var(--signal);
	color: var(--grafit);
	font-weight: 650;
}

.guide-step {
	min-width: 0;
	margin: 0 0 28px;
	padding: 0;
	border: 0;
}

.js .guide-form.is-stepper .guide-step {
	display: none;
}

.js .guide-form.is-stepper .guide-step.is-current {
	display: block;
}

.guide-step__q {
	margin-bottom: 6px;
	padding: 0;
	font-size: var(--step-2);
	font-weight: 750;
	font-stretch: 112%;
	letter-spacing: -0.01em;
	line-height: 1.15;
}

.guide-step__hint {
	margin: 0 0 16px;
	color: var(--steel);
	font-size: 0.9375rem;
}

.chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 12px;
}

.chip {
	position: relative;
}

.chip input {
	position: absolute;
	inset: 0;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.chip span {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	min-height: 44px;
	padding: 8px 14px;
	border: 1.5px solid var(--line);
	border-radius: var(--radius);
	background: var(--paper);
	font-size: 0.9375rem;
	font-weight: 560;
	cursor: pointer;
	user-select: none;
	transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.chip span::before {
	content: "";
	flex: none;
	width: 14px;
	height: 14px;
	border: 1.5px solid var(--steel);
	border-radius: 2px;
	background: var(--sheet);
}

.chip--radio span::before {
	border-radius: 50%;
}

.chip span:hover {
	border-color: var(--grafit);
}

.chip input:checked + span {
	border-color: var(--grafit);
	background: var(--grafit);
	color: var(--paper);
}

.chip input:checked + span::before {
	border-color: var(--signal);
	background: var(--signal);
	box-shadow: inset 0 0 0 2px var(--grafit);
}

.chip input:focus-visible + span {
	outline: 3px solid var(--signal);
	outline-offset: 2px;
}

.field {
	display: grid;
	gap: 6px;
	margin-top: 18px;
}

.field label {
	font-size: 0.875rem;
	font-weight: 620;
}

.field input,
.field textarea {
	width: 100%;
	min-height: 46px;
	padding: 10px 12px;
	border: 1.5px solid var(--line);
	border-radius: var(--radius);
	background: #FFFFFF;
	color: var(--grafit);
	font: inherit;
	font-size: 1rem;
}

.field textarea {
	min-height: 130px;
	resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
	color: #7C848B;
}

.field input:focus,
.field textarea:focus {
	outline: none;
	border-color: var(--grafit);
	box-shadow: 0 0 0 3px rgba(242, 85, 29, 0.4);
}

.field [aria-invalid="true"] {
	border-color: var(--signal-ink);
}

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

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

.field-error {
	margin: 8px 0 0;
	color: var(--signal-ink);
	font-size: 0.875rem;
	font-weight: 600;
}

.guide-step__privacy {
	margin: 20px 0 0;
	color: var(--steel);
	font-size: 0.875rem;
}

.guide-form__error {
	margin: 0 0 18px;
	padding: 10px 14px;
	border: 1px solid var(--signal-ink);
	border-radius: var(--radius);
	background: var(--signal-wash);
	color: #6E2608;
	font-size: 0.9375rem;
}

.guide-form__error a {
	color: inherit;
}

.guide-nav {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 10px;
	padding-top: 20px;
	border-top: 1px solid var(--line-soft);
}

.guide-nav [data-guide-back] {
	margin-right: auto;
}

.hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.slip__done {
	display: grid;
	justify-items: start;
	gap: 20px;
	padding: 12px 0 4px;
}

.stamp {
	display: inline-block;
	margin: 8px 0 0 6px;
	padding: 6px 18px;
	border: 4px solid currentColor;
	border-radius: 6px;
	color: var(--signal-ink);
	font-size: clamp(1.8rem, 4vw, 2.6rem);
	font-weight: 860;
	font-stretch: 125%;
	letter-spacing: 0.04em;
	line-height: 1.1;
	text-transform: uppercase;
	transform: rotate(-6deg);
}

@media (prefers-reduced-motion: no-preference) {
	.slip__done:not([hidden]) .stamp {
		animation: ks-stamp 0.38s cubic-bezier(0.2, 1.4, 0.4, 1) both;
	}
}

.slip__done-text {
	max-width: 38ch;
	margin: 0;
	font-size: var(--step-1);
	line-height: 1.5;
}

/* Footer ------------------------------------------------------------------ */

.site-footer {
	background: var(--grafit);
	color: var(--steel-dk);
	border-top: 1px solid var(--grafit-3);
	font-size: 0.9375rem;
}

.site-footer__inner {
	width: min(100% - 2 * var(--gutter), var(--max));
	margin-inline: auto;
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 4fr) minmax(0, 3fr);
	gap: 32px;
	padding: 56px 0 40px;
}

.site-footer .site-logo {
	width: 164px;
}

.site-footer__brand p {
	max-width: 32ch;
	margin: 18px 0 0;
}

.site-footer__title {
	margin: 0 0 12px;
	color: var(--paper);
	font-size: 0.875rem;
	font-weight: 650;
}

.site-footer a {
	color: var(--paper);
	text-decoration-color: var(--grafit-3);
}

.site-footer a:hover {
	text-decoration-color: var(--signal);
}

.company {
	font-style: normal;
	line-height: 1.8;
}

.company__label {
	color: var(--steel);
}

.site-footer .company__label {
	color: var(--steel-dk);
}

.site-footer__links {
	list-style: none;
	margin: 0;
	padding: 0;
	line-height: 2;
}

.site-footer__base {
	width: min(100% - 2 * var(--gutter), var(--max));
	margin-inline: auto;
	padding: 18px 0 28px;
	border-top: 1px solid var(--grafit-3);
	font-size: 0.8125rem;
}

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

/* Articles, pages, 404 ---------------------------------------------------- */

.page-head {
	padding-bottom: 28px;
}

.page-title {
	margin: 0 0 16px;
	font-size: var(--step-4);
	font-weight: 800;
	font-stretch: 118%;
	letter-spacing: -0.022em;
	line-height: 1.04;
}

.article__head {
	padding-top: clamp(48px, 7vw, 96px);
}

.article__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
	margin: 0 0 16px;
	color: var(--steel);
	font-size: 0.875rem;
}

.article__image {
	margin-top: 24px;
	margin-bottom: 32px;
}

.article__image img {
	width: 100%;
	border-radius: var(--radius-lg);
}

.prose {
	padding-bottom: clamp(64px, 8vw, 112px);
	font-size: 1.0625rem;
	line-height: 1.7;
}

.prose > * {
	max-width: 68ch;
}

.prose h2 {
	margin: 2em 0 0.5em;
	font-size: var(--step-2);
	font-weight: 750;
	font-stretch: 110%;
	letter-spacing: -0.01em;
	line-height: 1.2;
}

.prose h3 {
	margin: 1.6em 0 0.4em;
	font-size: var(--step-1);
	font-weight: 720;
	line-height: 1.25;
}

.prose p,
.prose ul,
.prose ol {
	margin: 0 0 1em;
}

.prose a {
	text-decoration-color: var(--signal);
	text-decoration-thickness: 2px;
}

.prose img {
	border-radius: var(--radius-lg);
}

.prose code {
	padding: 0.1em 0.35em;
	border-radius: 3px;
	background: var(--paper-2);
	font-family: var(--mono);
	font-size: 0.9em;
}

.prose pre {
	padding: 20px;
	border-radius: var(--radius-lg);
	background: var(--grafit);
	color: var(--code-text);
	font-size: 14px;
	overflow: auto;
}

.prose pre code {
	padding: 0;
	background: none;
	font-size: inherit;
}

.prose blockquote {
	margin: 1.5em 0;
	padding-left: 20px;
	border-left: 3px solid var(--signal);
}

.company-block {
	line-height: 1.8;
}

.empty-state {
	display: grid;
	justify-items: start;
	gap: 18px;
	padding: 24px 0 64px;
	color: var(--steel);
}

.pager {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	padding-top: 28px;
	font-weight: 600;
}

.not-found {
	padding: clamp(64px, 10vw, 140px) 0;
}

.not-found__code {
	margin: 0 0 8px;
	color: var(--signal);
	font-size: clamp(4rem, 12vw, 8rem);
	line-height: 1;
}

.not-found .btn {
	margin-top: 28px;
}

/* Command palette --------------------------------------------------------- */

.palette {
	width: min(560px, calc(100vw - 32px));
	margin: 12vh auto auto;
	padding: 0;
	border: 1px solid var(--grafit-3);
	border-radius: var(--radius-lg);
	background: var(--grafit);
	color: var(--paper);
}

.palette::backdrop {
	background: rgba(30, 34, 38, 0.5);
}

.palette__form {
	display: grid;
}

.palette__title {
	margin: 0;
	padding: 14px 16px 0;
	color: var(--steel-dk);
	font-size: 0.8125rem;
	font-weight: 620;
}

.palette__input {
	margin: 8px 12px 12px;
	padding: 12px;
	border: 1px solid var(--grafit-3);
	border-radius: var(--radius);
	background: var(--grafit-2);
	color: var(--paper);
	font: inherit;
	font-size: 1.0625rem;
}

.palette__input:focus {
	outline: 2px solid var(--signal);
	outline-offset: 1px;
}

.palette__list {
	list-style: none;
	max-height: 50vh;
	margin: 0;
	padding: 0 8px 8px;
	overflow: auto;
}

.palette__list li {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 12px;
	border-radius: var(--radius);
	cursor: pointer;
}

.palette__list li[aria-selected="true"] {
	background: var(--grafit-3);
}

.palette__list .hint {
	color: var(--steel-dk);
	font-family: var(--mono);
	font-size: 0.8125rem;
}

.palette__empty {
	margin: 0;
	padding: 0 20px 18px;
	color: var(--steel-dk);
}

/* Keyframes --------------------------------------------------------------- */

@keyframes ks-blink {
	50% {
		opacity: 0;
	}
}

@keyframes ks-failsafe {
	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes ks-pulse {
	0% {
		box-shadow: 0 0 0 0 rgba(242, 85, 29, 0.55);
	}

	70%,
	100% {
		box-shadow: 0 0 0 9px rgba(242, 85, 29, 0);
	}
}

@keyframes ks-drop {
	from {
		opacity: 0;
		transform: translateY(-8px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes ks-stamp {
	from {
		opacity: 0;
		transform: rotate(-6deg) scale(1.7);
	}

	to {
		opacity: 1;
		transform: rotate(-6deg) scale(1);
	}
}

/* Reduced motion ---------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
	}

	.caret {
		display: none;
	}
}

/* Print ------------------------------------------------------------------- */

@media print {
	.site-header,
	.hero__editor,
	.palette,
	.demo__controls,
	.guide {
		display: none !important;
	}

	body {
		background: #FFFFFF;
	}
}
