/* ==========================================================================
   Mikael Ahonen — Pyramid Farm
   Theme: 0toinf Discord × electrical panel
   Everything glows because it is either glass or carrying current.
   ========================================================================== */

:root {
	/* surfaces */
	--bg: #08060f;
	--glass: #14112b;

	/* 0toinf spectrum */
	--violet: #8b5cf6;
	--blurple: #5865f2;
	--cyan: #22d3ee;
	--amber: #fbbf24;

	/* structure */
	--line: #2a2450;
	--line-soft: #1d1838;
	--line-hi: #4c3fa0;

	/* type */
	--fg: #f2efff;
	--fg-2: #c3bce8;
	--fg-3: #8d84bd;
	--fg-4: #7a70bd;

	/* signal colours */
	--live: #a3e635;

	/* conductor */
	--wire: rgba(150, 142, 205, 0.6);

	--grad-main: linear-gradient(96deg, var(--violet), var(--blurple) 42%, var(--cyan));

	--metrics: 18px;
	--r-sm: 9px;
	--r: 15px;
	--r-lg: 22px;
	--shell: 1180px;
	--rail: 232px;

	--glow-v: 0 0 24px -6px #8b5cf6b3;

	--mono: "JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Code", Consolas,
		monospace;
	--sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
		"Helvetica Neue", Arial, sans-serif;
}

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

html {
	scroll-behavior: smooth;
	scroll-padding-top: 96px;
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--fg);
	font-family: var(--sans);
	font-size: 15px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: hidden;
}

/* ==========================================================================
   ambient VFX layer
   ========================================================================== */

.fx-canvas {
	position: fixed;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	opacity: 0.85;
}

.fx-canvas canvas {
	display: block;
	width: 100%;
	height: 100%;
}

.blob {
	position: fixed;
	z-index: 0;
	pointer-events: none;
	border-radius: 50%;
	filter: blur(88px);
	opacity: 0.5;
	will-change: transform;
}

.blob--a {
	width: 44rem;
	height: 44rem;
	top: -20rem;
	left: -12rem;
	background: radial-gradient(circle, #7c3aed 0%, transparent 68%);
	animation: drift-a 26s ease-in-out infinite;
}

.blob--b {
	width: 38rem;
	height: 38rem;
	top: -14rem;
	right: -14rem;
	background: radial-gradient(circle, #2563eb 0%, transparent 68%);
	animation: drift-b 32s ease-in-out infinite;
}

.blob--c {
	width: 40rem;
	height: 40rem;
	bottom: -24rem;
	left: 28%;
	background: radial-gradient(circle, #db2777 0%, transparent 70%);
	opacity: 0.32;
	animation: drift-c 38s ease-in-out infinite;
}

@keyframes drift-a {
	0%,
	100% {
		transform: translate3d(0, 0, 0) scale(1);
	}
	50% {
		transform: translate3d(6rem, 4rem, 0) scale(1.14);
	}
}

@keyframes drift-b {
	0%,
	100% {
		transform: translate3d(0, 0, 0) scale(1.06);
	}
	50% {
		transform: translate3d(-5rem, 5rem, 0) scale(0.94);
	}
}

@keyframes drift-c {
	0%,
	100% {
		transform: translate3d(0, 0, 0) scale(1);
	}
	50% {
		transform: translate3d(-7rem, -5rem, 0) scale(1.18);
	}
}

/* scanline sweep over the whole viewport */
.sweep {
	position: fixed;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	overflow: hidden;
}

.sweep::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	height: 34vh;
	background: linear-gradient(
		to bottom,
		transparent,
		#22d3ee09 42%,
		#8b5cf60f 55%,
		transparent
	);
	animation: sweep 11s linear infinite;
}

@keyframes sweep {
	0% {
		transform: translateY(-40vh);
	}
	100% {
		transform: translateY(110vh);
	}
}

/* ==========================================================================
   shared
   ========================================================================== */

::selection {
	background: #8b5cf666;
	color: #fff;
}

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

.shell {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: var(--shell);
	margin: 0 auto;
	padding: 0 28px;
}

.vh {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* scroll progress */
.progress {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 90;
	height: 3px;
	width: 100%;
	transform: scaleX(0);
	transform-origin: 0 50%;
	background: var(--grad-main);
	box-shadow: 0 0 14px -2px var(--violet);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.progress.is-live {
	opacity: 1;
}

/* ==========================================================================
   top bar
   ========================================================================== */

.top {
	position: sticky;
	top: 0;
	z-index: 60;
	background: #08060fcc;
	backdrop-filter: blur(22px) saturate(170%);
	-webkit-backdrop-filter: blur(22px) saturate(170%);
	border-bottom: 1px solid var(--line);
	box-shadow: 0 1px 0 #8b5cf61f, 0 12px 34px -22px #8b5cf6;
}

.top__in {
	display: flex;
	align-items: center;
	gap: 18px;
	height: 60px;
}

.id {
	display: flex;
	align-items: baseline;
	gap: 9px;
	flex: none;
	text-decoration: none;
	color: inherit;
}

.id__name {
	font-size: 14.5px;
	font-weight: 600;
	letter-spacing: -0.01em;
	background: linear-gradient(96deg, #fff, #c4b5fd);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.id__handle {
	font-family: var(--mono);
	font-size: 11.5px;
	color: var(--violet);
	transition: text-shadow 0.16s ease;
}

.id:hover .id__handle {
	text-shadow: 0 0 14px var(--violet);
}

.nav {
	display: flex;
	align-items: center;
	gap: 3px;
}

.nav a {
	position: relative;
	padding: 6px 11px;
	border-radius: 99px;
	color: var(--fg-3);
	font-family: var(--mono);
	font-size: 11.5px;
	text-decoration: none;
	white-space: nowrap;
	transition: color 0.16s ease, background 0.16s ease;
}

.nav a:hover {
	color: #fff;
	background: #8b5cf626;
}

.nav a.is-current {
	color: #fff;
	background: #8b5cf640;
	box-shadow: inset 0 0 0 1px #8b5cf666;
}

.top__end {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 14px;
	flex: none;
}

.bus {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 4px 11px 4px 9px;
	border: 1px solid #4ade8040;
	border-radius: 99px;
	background: #4ade8014;
	font-family: var(--mono);
	font-size: 11px;
	color: #86efac;
	white-space: nowrap;
	box-shadow: 0 0 18px -8px #4ade80;
}

.bus__v {
	font-weight: 500;
	color: #d9f99d;
}

.led {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--live);
	flex: none;
	position: relative;
}

.led::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: var(--live);
	animation: blink 1.6s ease-in-out infinite;
}

.led--amber::after {
	background: var(--amber);
	animation-duration: 0.7s;
}

@keyframes blink {
	0%,
	100% {
		transform: scale(1);
		opacity: 0.75;
	}
	50% {
		transform: scale(2.5);
		opacity: 0;
	}
}

.clocks {
	display: flex;
	align-items: baseline;
	gap: 9px;
	font-family: var(--mono);
	font-size: 11.5px;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.clocks .k {
	color: var(--fg-4);
	font-size: 9.5px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.clocks .utc {
	color: var(--cyan);
	font-weight: 500;
	text-shadow: 0 0 12px #22d3ee66;
}

.clocks .local {
	color: var(--fg-3);
}

/* ==========================================================================
   hero
   ========================================================================== */

.hero {
	position: relative;
	z-index: 2;
	padding: 96px 0 66px;
}

.eyebrow {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	font-family: var(--mono);
	font-size: 11.5px;
	color: var(--fg-3);
	margin-bottom: 26px;
}

.eyebrow .tag {
	padding: 3px 10px;
	border: 1px solid var(--line-hi);
	border-radius: 99px;
	background: #8b5cf614;
	color: var(--violet);
	letter-spacing: 0.04em;
	text-transform: uppercase;
	font-size: 10px;
	box-shadow: var(--glow-v);
}

.eyebrow .sep {
	color: var(--line-hi);
}

.eyebrow .on {
	color: var(--live);
}

.hero h1 {
	margin: 0;
	font-size: clamp(38px, 6.6vw, 74px);
	line-height: 1.02;
	letter-spacing: -0.04em;
	font-weight: 700;
	text-wrap: balance;
}

.hero h1 .grad {
	background: var(--grad-main);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	filter: drop-shadow(0 0 26px #8b5cf666);
}

.hero h1 .dim {
	color: var(--fg-4);
}

.hero__lede {
	margin: 30px 0 0;
	max-width: 62ch;
	font-size: 17px;
	line-height: 1.7;
	color: var(--fg-2);
	text-wrap: pretty;
}

.hero__lede b {
	color: var(--fg);
	font-weight: 500;
}

.hero__acts {
	margin-top: 34px;
	display: flex;
	flex-wrap: wrap;
	gap: 11px;
}

.btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 40px;
	padding: 0 20px;
	border: 1px solid var(--line-hi);
	border-radius: 99px;
	background: var(--glass);
	color: var(--fg);
	font-family: var(--mono);
	font-size: 12px;
	text-decoration: none;
	cursor: pointer;
	overflow: hidden;
	transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1),
		box-shadow 0.2s ease, border-color 0.2s ease;
}

.btn::before {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--grad-main);
	opacity: 0;
	transition: opacity 0.2s ease;
	z-index: -1;
}

.btn > * {
	position: relative;
}

.btn svg {
	width: 14px;
	height: 14px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.7;
	stroke-linecap: round;
	stroke-linejoin: round;
	flex: none;
}

.btn:hover {
	transform: translateY(-2px);
	border-color: var(--violet);
	box-shadow: var(--glow-v);
}

.btn:hover::before {
	opacity: 0.16;
}

.btn--primary {
	background: var(--grad-main);
	border-color: transparent;
	color: #0b0518;
	font-weight: 500;
	box-shadow: 0 6px 26px -10px var(--violet), var(--glow-v);
}

.btn--primary:hover {
	box-shadow: 0 10px 34px -10px var(--violet), 0 0 30px -6px var(--cyan);
}

.btn.is-done {
	color: var(--live);
	border-color: #4ade8059;
	box-shadow: 0 0 20px -8px var(--live);
}

/* live electrical readout strip */
.vitals {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: var(--metrics);
	margin-top: 56px;
}

.vital {
	position: relative;
	padding: 18px 20px;
	border: 1px solid var(--line);
	border-radius: var(--r-lg);
	background: linear-gradient(160deg, #1a1640d9, #0d0b1ecc);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	overflow: hidden;
	transition: transform 0.2s ease, border-color 0.2s ease;
}

.vital::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	padding: 1px;
	background: linear-gradient(140deg, #8b5cf666, transparent 42%, #22d3ee4d);
	-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
	-webkit-mask-composite: xor;
	mask-composite: exclude;
	pointer-events: none;
}

.vital:hover {
	transform: translateY(-3px);
	border-color: var(--line-hi);
}

.vital .k {
	font-family: var(--mono);
	font-size: 9.5px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--fg-4);
}

.vital .v {
	margin-top: 7px;
	font-family: var(--mono);
	font-size: 22px;
	font-weight: 500;
	letter-spacing: -0.02em;
	color: #fff;
	font-variant-numeric: tabular-nums;
	text-shadow: 0 0 22px #8b5cf6aa;
}

.vital .v small {
	font-size: 11px;
	color: var(--fg-3);
	text-shadow: none;
	margin-left: 3px;
}

.vital .sub {
	margin-top: 4px;
	font-size: 11.5px;
	color: var(--fg-3);
}

/* runtime-tunable custom properties (set by script.js) */
.age {
	font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   section scaffold
   ========================================================================== */

/* section rule: a copper trace with vias, not a hairline */
.sec {
	position: relative;
	z-index: 2;
	display: grid;
	grid-template-columns: var(--rail) minmax(0, 1fr);
	gap: 48px;
	padding: 88px 0;
}
.sec::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 7px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='7' viewBox='0 0 160 7'%3E%3Cpath d='M0 3.5h44v-3h34v7h44v-3h38' fill='none' stroke='%235b4fc4' stroke-width='1.3'/%3E%3Cg fill='%2308060f' stroke='%238b5cf6' stroke-width='1.2'%3E%3Ccircle cx='44' cy='3.5' r='2'/%3E%3Ccircle cx='122' cy='3.5' r='2'/%3E%3C/g%3E%3C/svg%3E");
	background-repeat: repeat-x;
	background-position: center;
	opacity: 0.55;
	pointer-events: none;
}

.sec__rail {
	position: sticky;
	top: 92px;
	align-self: start;
}

.sec__num {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-family: var(--mono);
	font-size: 10.5px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--cyan);
	text-shadow: 0 0 14px #22d3ee80;
}

.sec__num::before {
	content: "";
	width: 16px;
	height: 1px;
	background: linear-gradient(90deg, transparent, var(--cyan));
}

.sec__rail h2 {
	margin: 12px 0 0;
	font-size: 20px;
	font-weight: 600;
	letter-spacing: -0.025em;
	line-height: 1.22;
}

.sec__rail p {
	margin: 12px 0 0;
	font-family: var(--mono);
	font-size: 11.5px;
	line-height: 1.62;
	color: var(--fg-3);
}

.sec__body {
	min-width: 0;
}

.prose {
	max-width: 66ch;
	color: var(--fg-2);
	font-size: 15.5px;
}

.prose p {
	margin: 0 0 16px;
	text-wrap: pretty;
}

.prose p:last-child {
	margin-bottom: 0;
}

.prose b {
	color: var(--fg);
	font-weight: 500;
}

.prose code,
.note code,
.rig code {
	font-family: var(--mono);
	font-size: 0.85em;
	padding: 1.5px 6px;
	border: 1px solid var(--line-hi);
	border-radius: 5px;
	background: #8b5cf61a;
	color: #ddd6fe;
	white-space: nowrap;
}

.note {
	margin-top: 26px;
	padding: 15px 18px;
	border: 1px solid var(--line);
	border-left: 3px solid var(--violet);
	border-radius: 0 var(--r) var(--r) 0;
	background: linear-gradient(100deg, #8b5cf614, transparent 65%), var(--glass);
	color: var(--fg-2);
	font-size: 14px;
}

.note b {
	color: var(--fg);
	font-weight: 500;
}

/* ==========================================================================
   definition list
   ========================================================================== */

.dl {
	margin: 0;
	display: grid;
	grid-template-columns: 158px minmax(0, 1fr);
}

.dl > div {
	display: contents;
}

.dl dt,
.dl dd {
	margin: 0;
	padding: 13px 0;
	border-bottom: 1px solid var(--line-soft);
	font-size: 14px;
}

.dl dt {
	font-family: var(--mono);
	font-size: 10.5px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--fg-4);
	align-self: center;
}

.dl dd {
	color: var(--fg);
}

.dl dd .mut {
	color: var(--fg-3);
}

/* ==========================================================================
   cards
   ========================================================================== */

.cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(262px, 1fr));
	gap: var(--metrics);
	margin-top: 34px;
}

.card {
	--mx: 50%;
	--my: 50%;
	position: relative;
	padding: 20px;
	border: 1px solid var(--line);
	border-radius: var(--r-lg);
	background: linear-gradient(165deg, #171334e0, #0c0a1ad9);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	overflow: hidden;
	transition: transform 0.24s cubic-bezier(0.22, 0.61, 0.36, 1),
		border-color 0.24s ease;
}

.card::before {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(
		22rem 16rem at var(--mx) var(--my),
		#8b5cf640,
		transparent 65%
	);
	opacity: 0;
	transition: opacity 0.24s ease;
	pointer-events: none;
}

.card:hover {
	transform: translateY(-3px);
	border-color: var(--line-hi);
}

.card:hover::before {
	opacity: 1;
}

.card .k {
	display: flex;
	align-items: center;
	gap: 8px;
	font-family: var(--mono);
	font-size: 10px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--fg-4);
	margin-bottom: 11px;
}

.card .k::before {
	content: "";
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var(--violet);
	box-shadow: 0 0 10px var(--violet);
	flex: none;
}

.card h3 {
	margin: 0 0 8px;
	font-size: 15px;
	font-weight: 550;
	letter-spacing: -0.012em;
}

.card p {
	margin: 0;
	font-size: 13.5px;
	line-height: 1.62;
	color: var(--fg-3);
}

.card p b {
	color: var(--fg-2);
	font-weight: 500;
}

.card .n {
	display: inline-grid;
	place-items: center;
	width: 24px;
	height: 24px;
	margin-bottom: 11px;
	border: 1px solid var(--line-hi);
	border-radius: 8px;
	background: #8b5cf61f;
	font-family: var(--mono);
	font-size: 11px;
	color: var(--cyan);
}

/* ==========================================================================
   split panels
   ========================================================================== */

.split {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--metrics);
	margin-top: 34px;
}

.panel {
	border: 1px solid var(--line);
	border-radius: var(--r-lg);
	background: linear-gradient(170deg, #161232e0, #0b0919d9);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	overflow: hidden;
}

.panel > header {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 13px 17px;
	border-bottom: 1px solid var(--line);
	background: #8b5cf610;
	font-family: var(--mono);
	font-size: 10.5px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--fg-2);
}

.panel > header .pill {
	margin-left: auto;
	padding: 2px 9px;
	border: 1px solid var(--line-hi);
	border-radius: 99px;
	background: #08060fcc;
	font-size: 9.5px;
	color: var(--fg-4);
	letter-spacing: 0.06em;
	text-transform: none;
}

.panel ul {
	list-style: none;
	margin: 0;
	padding: 6px 0;
}

.panel li {
	display: flex;
	gap: 12px;
	padding: 10px 17px;
	font-size: 13.5px;
	color: var(--fg-2);
	border-bottom: 1px solid var(--line-soft);
}

.panel li:last-child {
	border-bottom: 0;
}

.panel li .b {
	font-family: var(--mono);
	font-size: 10.5px;
	color: var(--violet);
	flex: none;
	padding-top: 3px;
	min-width: 74px;
}

.panel li .b--c {
	color: var(--cyan);
}

/* ==========================================================================
   stack chips
   ========================================================================== */

.stack {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 30px;
}

.stack span {
	padding: 6px 13px;
	border: 1px solid var(--line);
	border-radius: 99px;
	background: #8b5cf612;
	font-family: var(--mono);
	font-size: 11.5px;
	color: var(--fg-2);
	transition: border-color 0.18s ease, box-shadow 0.18s ease,
		transform 0.18s ease;
}

.stack span:hover {
	border-color: var(--violet);
	box-shadow: var(--glow-v);
	transform: translateY(-2px);
}

.stack span i {
	font-style: normal;
	color: var(--cyan);
	margin-right: 7px;
}

/* ==========================================================================
   rig
   ========================================================================== */

.rig {
	margin-top: 34px;
	border: 1px solid var(--line);
	border-radius: var(--r-lg);
	background: linear-gradient(175deg, #171334e0, #08060fe6);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	overflow: hidden;
}

.rig__desk {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	border-bottom: 1px solid var(--line);
}

.rig__slot {
	padding: 20px 18px;
	border-right: 1px solid var(--line);
	min-width: 0;
}

.rig__slot:last-child {
	border-right: 0;
}

.rig__slot .label {
	font-family: var(--mono);
	font-size: 9.5px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--fg-4);
	margin-bottom: 12px;
}

.rig__slot .item + .item {
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px dashed var(--line-soft);
}

.rig__slot .nm {
	font-size: 13.5px;
	color: var(--fg);
}

.rig__slot .ds {
	font-family: var(--mono);
	font-size: 11px;
	color: var(--fg-3);
	margin-top: 3px;
}

.rig__foot {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 15px 18px;
	background: #05040ccc;
	font-size: 11px;
}

.rig__foot .tagx {
	padding: 3px 11px;
	border: 1px solid var(--line);
	border-radius: 99px;
	background: #8b5cf614;
	font-family: var(--mono);
	color: var(--fg-3);
}

/* ==========================================================================
   circuit lab
   ========================================================================== */

.lab {
	margin-top: 34px;
	border: 1px solid var(--line);
	border-radius: var(--r-lg);
	background: linear-gradient(170deg, #161232e6, #08060ff2);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	overflow: hidden;
}

.lab__bar {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	padding: 0 16px;
	height: 46px;
	border-bottom: 1px solid var(--line);
	background: #8b5cf60f;
	font-family: var(--mono);
	font-size: 11px;
	color: var(--fg-3);
}

.lab__bar b {
	color: var(--fg);
	font-weight: 500;
}

.lab__bar .spacer {
	margin-left: auto;
}

.lab__grid {
	display: grid;
	grid-template-columns: 290px minmax(0, 1fr);
}

.lab__ctrl {
	padding: 20px;
	border-right: 1px solid var(--line);
	background: #08060f80;
}

.ctl {
	margin-bottom: 20px;
}

.ctl:last-child {
	margin-bottom: 0;
}

.ctl label {
	display: flex;
	align-items: baseline;
	gap: 8px;
	font-family: var(--mono);
	font-size: 10.5px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--fg-4);
	margin-bottom: 9px;
}

.ctl label b {
	margin-left: auto;
	font-size: 15px;
	letter-spacing: -0.01em;
	text-transform: none;
	color: var(--cyan);
	font-weight: 500;
	font-variant-numeric: tabular-nums;
	text-shadow: 0 0 14px #22d3ee80;
}

.ctl label b.hot {
	color: var(--amber);
	text-shadow: 0 0 14px #fbbf2480;
}

input[type="range"] {
	--fill: 50%;
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	height: 5px;
	border-radius: 99px;
	background: linear-gradient(
		90deg,
		var(--violet) 0%,
		var(--cyan) var(--fill),
		#221d44 var(--fill),
		#221d44 100%
	);
	cursor: pointer;
	outline: none;
}

input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 17px;
	height: 17px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid var(--violet);
	box-shadow: 0 0 0 4px #8b5cf626, 0 0 16px var(--violet);
	cursor: grab;
	transition: transform 0.14s ease;
}

input[type="range"]::-webkit-slider-thumb:active {
	transform: scale(1.2);
	cursor: grabbing;
}

input[type="range"]::-moz-range-thumb {
	width: 15px;
	height: 15px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid var(--violet);
	box-shadow: 0 0 0 4px #8b5cf626, 0 0 16px var(--violet);
}

.readouts {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 10px;
	margin-top: 20px;
}

.ro {
	padding: 12px 13px;
	border: 1px solid var(--line);
	border-radius: var(--r-sm);
	background: #08060f9c;
}

.ro .k {
	font-family: var(--mono);
	font-size: 9px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--fg-4);
}

.ro .v {
	margin-top: 4px;
	font-family: var(--mono);
	font-size: 16px;
	font-weight: 500;
	color: #fff;
	font-variant-numeric: tabular-nums;
}

.ro .v small {
	font-size: 10px;
	color: var(--fg-3);
	margin-left: 3px;
}

.ro--warn {
	border-color: #fbbf2440;
	background: #fbbf240f;
}

.ro--warn .v {
	color: var(--amber);
}

.verdict {
	margin-top: 14px;
	padding: 11px 13px;
	border-radius: var(--r-sm);
	border: 1px solid var(--line);
	background: #05040c99;
	font-family: var(--mono);
	font-size: 11.5px;
	line-height: 1.55;
	color: var(--fg-2);
}

.verdict b {
	color: var(--live);
}

.verdict.is-warn {
	border-color: #fbbf2459;
	background: #fbbf2414;
	color: #fde68a;
}

.verdict.is-warn b {
	color: var(--amber);
}

.verdict.is-off {
	border-color: var(--line);
	color: var(--fg-3);
}

.verdict.is-off b {
	color: var(--fg-3);
}

/* schematic */
.schem {
	position: relative;
	padding: 22px;
	display: grid;
	place-items: center;
	min-height: 340px;
}

.schem svg {
	width: 100%;
	max-width: 620px;
	height: auto;
	overflow: visible;
}

.wire {
	fill: none;
	stroke: #4c3fa0;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.wire-flow {
	--flow-dur: 1.6s;
	fill: none;
	stroke: url(#flowGrad);
	stroke-width: 2.4;
	stroke-linecap: round;
	stroke-dasharray: 14 130;
	opacity: 0.95;
	animation: flow var(--flow-dur) linear infinite;
}

@keyframes flow {
	to {
		stroke-dashoffset: -144;
	}
}

.node {
	fill: #08060f;
	stroke: var(--violet);
	stroke-width: 1.6;
}

.node-label {
	font-family: "JetBrains Mono", monospace;
	font-size: 9px;
	fill: var(--fg-4);
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.part-label {
	font-family: "JetBrains Mono", monospace;
	font-size: 10px;
	fill: var(--fg-2);
}

.value-label {
	font-family: "JetBrains Mono", monospace;
	font-size: 11px;
	font-weight: 500;
	fill: var(--cyan);
}

.led-off {
	fill: #2a2450;
	stroke: var(--fg-4);
	stroke-width: 1.4;
}

.led-on {
	--led-glow: 2px;
	fill: #fb7185;
	stroke: #fecdd3;
	stroke-width: 1.4;
	filter: drop-shadow(0 0 var(--led-glow) #fb7185);
}

.res-body {
	fill: none;
	stroke: #a78bfa;
	stroke-width: 2.2;
	stroke-linejoin: round;
	stroke-linecap: round;
}

.res-hot {
	fill: none;
	stroke: var(--amber);
	stroke-width: 2.2;
	stroke-linejoin: round;
	stroke-linecap: round;
	filter: drop-shadow(0 0 6px var(--amber));
}



/* ==========================================================================
   code viewer
   ========================================================================== */

.viewer {
	margin-top: 34px;
	border: 1px solid var(--line);
	border-radius: var(--r-lg);
	background: #05040cf2;
	overflow: hidden;
}

.vw__bar {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	padding: 0 13px;
	height: 48px;
	border-bottom: 1px solid var(--line);
	background: linear-gradient(100deg, #8b5cf61a, #5865f212);
}

.vw__file {
	display: flex;
	align-items: center;
	gap: 8px;
	font-family: var(--mono);
	font-size: 12px;
	color: var(--fg-3);
	min-width: 0;
}

.vw__file b {
	color: var(--fg);
	font-weight: 500;
}

.vw__file .chip {
	padding: 2px 9px;
	border: 1px solid var(--line-hi);
	border-radius: 99px;
	background: #08060fbf;
	font-size: 9.5px;
	color: var(--cyan);
	letter-spacing: 0.04em;
	white-space: nowrap;
}

.vw__tools {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.vw__search {
	position: relative;
	display: flex;
	align-items: center;
}

.vw__search svg {
	position: absolute;
	left: 10px;
	width: 12px;
	height: 12px;
	fill: none;
	stroke: var(--fg-4);
	stroke-width: 1.7;
	stroke-linecap: round;
	pointer-events: none;
}

.vw__search input {
	width: 148px;
	height: 28px;
	padding: 0 26px 0 28px;
	border: 1px solid var(--line);
	border-radius: 99px;
	background: #08060fcc;
	color: var(--fg);
	font-family: var(--mono);
	font-size: 11.5px;
	transition: border-color 0.18s ease, width 0.22s ease,
		box-shadow 0.18s ease;
}

.vw__search input::placeholder {
	color: var(--fg-4);
}

.vw__search input:focus {
	outline: none;
	width: 196px;
	border-color: var(--violet);
	box-shadow: var(--glow-v);
}

.vw__search input::-webkit-search-cancel-button {
	filter: invert(0.6);
	cursor: pointer;
}

.vw__search kbd {
	position: absolute;
	right: 8px;
	padding: 0 4px;
	border: 1px solid var(--line);
	border-radius: 4px;
	font-family: var(--mono);
	font-size: 9.5px;
	color: var(--fg-4);
	pointer-events: none;
}

.vw__search input:focus ~ kbd {
	opacity: 0;
}

.tgl {
	display: inline-flex;
	align-items: center;
	height: 28px;
	padding: 0 13px;
	border: 1px solid var(--line);
	border-radius: 99px;
	background: #08060fcc;
	color: var(--fg-3);
	font-family: var(--mono);
	font-size: 11px;
	cursor: pointer;
	transition: color 0.16s ease, border-color 0.16s ease,
		box-shadow 0.16s ease;
}

.tgl:hover {
	color: #fff;
	border-color: var(--line-hi);
}

.tgl[aria-pressed="true"] {
	color: #fff;
	border-color: var(--violet);
	background: #8b5cf633;
	box-shadow: var(--glow-v);
}

.hint {
	font-family: var(--mono);
	font-size: 9.5px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--fg-4);
	transition: opacity 0.25s ease;
	white-space: nowrap;
}

.vw__stats {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	padding: 8px 15px;
	border-bottom: 1px solid var(--line-soft);
	background: #07050fcc;
	font-family: var(--mono);
	font-size: 10.5px;
	color: var(--fg-4);
	letter-spacing: 0.03em;
}

.vw__stats .spacer {
	margin-left: auto;
}

.vw__stats .hit {
	color: var(--cyan);
}

.vw__stats .none {
	color: var(--amber);
}

.code {
	margin: 0;
	max-height: 620px;
	overflow: auto;
	padding: 15px 0;
	font-family: var(--mono);
	font-size: 12.5px;
	line-height: 1.64;
	tab-size: 4;
	scrollbar-width: thin;
	scrollbar-color: #4c3fa0 transparent;
	overscroll-behavior: contain;
}

.code::-webkit-scrollbar {
	width: 12px;
	height: 12px;
}

.code::-webkit-scrollbar-track {
	background: #05040c;
	border-left: 1px solid var(--line-soft);
}

.code::-webkit-scrollbar-thumb {
	background: linear-gradient(180deg, var(--violet), var(--blurple));
	border: 3px solid #05040c;
	border-radius: 7px;
}

.code::-webkit-scrollbar-thumb:hover {
	background: linear-gradient(180deg, #a78bfa, #7c8cf8);
}

.code::-webkit-scrollbar-corner {
	background: #05040c;
}

.code code {
	display: block;
	min-width: max-content;
	padding: 0 18px;
	counter-reset: ln;
}

.row {
	display: block;
	min-height: 1.64em;
}

.row::before {
	counter-increment: ln;
	content: counter(ln);
	display: inline-block;
	width: 48px;
	margin-right: 18px;
	text-align: right;
	color: #6d63b4;
	user-select: none;
	-webkit-user-select: none;
}

.code.is-filtering .row {
	opacity: 0.2;
	transition: opacity 0.14s ease;
}

.row.is-hit {
	opacity: 1;
	background: #8b5cf61f;
	box-shadow: inset 2px 0 0 var(--violet);
}

.code.is-wrapped code {
	min-width: 0;
	white-space: pre-wrap;
	word-break: break-word;
}

.code.is-wrapped .row::before {
	position: sticky;
	left: 0;
	background: #05040c;
	padding-right: 10px;
	margin-right: 10px;
}

.t-kw {
	color: #c084fc;
}
.t-fn {
	color: #67e8f9;
}
.t-str {
	color: #bef264;
}
.t-num {
	color: #fdba74;
}
.t-com {
	color: #7d74c4;
	font-style: italic;
}
.t-op {
	color: #f0abfc;
}

mark.hl {
	background: #22d3ee3d;
	color: #a5f3fc;
	border-radius: 3px;
	padding: 0 2px;
	box-shadow: 0 0 12px -3px var(--cyan);
}

/* ==========================================================================
   timeline
   ========================================================================== */

.tl {
	margin-top: 34px;
	position: relative;
	padding-left: 24px;
}

.tl::before {
	content: "";
	position: absolute;
	left: 4px;
	top: 8px;
	bottom: 8px;
	width: 1px;
	background: linear-gradient(180deg, var(--violet), var(--cyan), var(--line-soft));
}

.tl__item {
	position: relative;
	padding-bottom: 26px;
}

.tl__item:last-child {
	padding-bottom: 0;
}

.tl__item::before {
	content: "";
	position: absolute;
	left: -24px;
	top: 7px;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: #08060f;
	border: 1px solid var(--line-hi);
}

.tl__item.is-now::before {
	border-color: var(--live);
	background: var(--live);
	box-shadow: 0 0 0 4px #a3e6352e, 0 0 16px var(--live);
	animation: blink 2s ease-in-out infinite;
}

.tl__when {
	font-family: var(--mono);
	font-size: 10.5px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--fg-4);
}

.tl__what {
	margin-top: 4px;
	font-size: 14.5px;
	color: var(--fg);
}

.tl__what b {
	font-weight: 500;
	background: linear-gradient(96deg, #ddd6fe, #a5f3fc);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.tl__note {
	margin-top: 4px;
	font-size: 13.5px;
	color: var(--fg-3);
}

/* ==========================================================================
   contact
   ========================================================================== */

.links {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(236px, 1fr));
	gap: 12px;
	margin-top: 34px;
}

.link {
	display: flex;
	align-items: center;
	gap: 13px;
	padding: 16px 17px;
	border: 1px solid var(--line);
	border-radius: var(--r-lg);
	background: linear-gradient(160deg, #171334d9, #0c0a1ad9);
	text-decoration: none;
	transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
		border-color 0.2s ease, box-shadow 0.2s ease;
}

.link:hover {
	transform: translateY(-3px);
	border-color: var(--violet);
	box-shadow: var(--glow-v);
}

.link__ic {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	flex: none;
	border: 1px solid var(--line-hi);
	border-radius: 11px;
	background: #8b5cf626;
	color: #ddd6fe;
	transition: background 0.2s ease, box-shadow 0.2s ease;
}

.link:hover .link__ic {
	background: #8b5cf652;
	box-shadow: var(--glow-v);
}

.link__ic svg {
	width: 16px;
	height: 16px;
	fill: currentColor;
}

.link__tx b {
	display: block;
	font-size: 13.5px;
	font-weight: 500;
	color: var(--fg);
}

.link__tx span {
	font-family: var(--mono);
	font-size: 11px;
	color: var(--fg-3);
}

.link__arw {
	margin-left: auto;
	color: var(--fg-4);
	flex: none;
	transition: transform 0.2s ease, color 0.2s ease;
}

.link:hover .link__arw {
	transform: translate(2px, -2px);
	color: var(--cyan);
}

.link__arw svg {
	width: 13px;
	height: 13px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* ==========================================================================
   footer
   ========================================================================== */

.foot {
	position: relative;
	z-index: 2;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 20px;
	padding: 32px 0 46px;
	font-family: var(--mono);
	font-size: 11.5px;
	color: var(--fg-4);
}

.foot .spacer {
	margin-left: auto;
}

.foot a {
	color: var(--fg-3);
	text-decoration: none;
	transition: color 0.16s ease, text-shadow 0.16s ease;
}

.foot a:hover {
	color: var(--cyan);
	text-shadow: 0 0 14px #22d3ee80;
}

/* ==========================================================================
   PLC ladder logic
   ========================================================================== */

.plc {
	position: relative;
	border: 1px solid var(--line);
	border-radius: 18px;
	background: linear-gradient(180deg, rgba(23, 19, 52, 0.62), rgba(13, 10, 26, 0.78));
	overflow: hidden;
}

.plc__bar {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 16px;
	border-bottom: 1px solid var(--line);
	background: rgba(10, 8, 20, 0.5);
	font-family: var(--mono);
	font-size: 11.5px;
	color: var(--fg-3);
}
.plc__bar b {
	color: var(--fg);
	font-size: 12.5px;
	letter-spacing: 0.06em;
}
.plc__bar .spacer {
	flex: 1;
}
.chipx {
	padding: 3px 9px;
	border-radius: 999px;
	border: 1px solid var(--line-hi);
	background: rgba(139, 92, 246, 0.12);
	color: #c4b5fd;
	font-size: 10.5px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	transition: 0.25s ease;
}
.chipx.is-run {
	background: rgba(34, 211, 238, 0.14);
	border-color: rgba(34, 211, 238, 0.45);
	color: var(--cyan);
}
.chipx.is-fault {
	background: rgba(251, 191, 36, 0.14);
	border-color: rgba(251, 191, 36, 0.5);
	color: var(--amber);
}

/* rails + rungs ------------------------------------------------ */

.ladder {
	position: relative;
	padding: 26px 18px 22px;
	overflow-x: auto;
}
.ladder::before,
.ladder::after {
	content: "";
	position: absolute;
	top: 18px;
	bottom: 18px;
	width: 2px;
	border-radius: 2px;
	background: linear-gradient(180deg, rgba(139, 92, 246, 0.12), rgba(88, 101, 242, 0.5), rgba(139, 92, 246, 0.12));
}
.ladder::before {
	left: 9px;
}
.ladder::after {
	right: 9px;
}

.rung + .rung {
	margin-top: 20px;
}
.rung__lbl {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 7px 6px;
	font-family: var(--mono);
	font-size: 10.5px;
	color: var(--fg-4);
	letter-spacing: 0.02em;
}
.rung__n {
	padding: 1px 5px;
	border-radius: 4px;
	background: rgba(88, 101, 242, 0.14);
	border: 1px solid rgba(88, 101, 242, 0.28);
	color: #a5b4fc;
	font-size: 10px;
}
.rung__row {
	display: flex;
	align-items: flex-start;
	min-height: 54px;
}
.rung__row::after {
	content: "";
	flex: 1 1 auto;
	align-self: center;
	border-top: 2px solid var(--wire);
	opacity: 0.75;
}

/* contact ----------------------------------------------------- */

.ct {
	position: relative;
	flex: 0 0 auto;
	width: 62px;
	height: 40px;
	padding: 0;
	border: 0;
	background: none;
	font-family: var(--mono);
	font-size: 10px;
	color: var(--fg-3);
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.ct::before,
.ct::after {
	content: "";
	position: absolute;
	top: 50%;
	width: 27px;
	border-top: 2px solid var(--wire);
	transition: 0.2s ease;
}
.ct::before {
	left: 0;
}
.ct::after {
	right: 0;
}
.ct__bars {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 10px;
	height: 24px;
	transform: translate(-50%, -50%);
	border-left: 2px solid var(--wire);
	border-right: 2px solid var(--wire);
	transition: 0.2s ease;
}
.ct--nc .ct__bars::after {
	content: "";
	position: absolute;
	left: 50%;
	top: -3px;
	width: 2px;
	height: 30px;
	transform: translateX(-50%) rotate(38deg);
	background: var(--wire);
	transition: 0.2s ease;
}
.ct--coil {
	cursor: default;
	color: var(--fg-4);
}
.ct__tag,
.coil__tag,
.lamp__tag {
	position: absolute;
	top: calc(100% - 2px);
	left: 50%;
	transform: translateX(-50%);
	font-size: 9.5px;
	letter-spacing: 0.04em;
	white-space: nowrap;
	color: var(--fg-4);
	transition: 0.2s ease;
}
.ct:hover:not(.ct--coil)::before,
.ct:hover:not(.ct--coil)::after,
.ct:hover:not(.ct--coil) .ct__bars {
	border-color: #a5b4fc;
}
.ct:focus-visible {
	outline: 2px solid var(--cyan);
	outline-offset: 3px;
	border-radius: 4px;
}

/* conducting state: violet current */
.ct.is-on::before,
.ct.is-on::after {
	border-color: var(--cyan);
	box-shadow: 0 0 9px rgba(34, 211, 238, 0.55);
}
.ct.is-on .ct__bars {
	border-color: var(--cyan);
	box-shadow: 0 0 9px rgba(34, 211, 238, 0.55);
}
.ct.is-on.ct--nc .ct__bars::after {
	background: var(--cyan);
	box-shadow: 0 0 9px rgba(34, 211, 238, 0.55);
}
.ct.is-on .ct__tag {
	color: var(--cyan);
}
.ct.is-hold::before,
.ct.is-hold::after,
.ct.is-hold .ct__bars {
	border-color: #a78bfa;
	box-shadow: 0 0 8px rgba(167, 139, 250, 0.5);
}
.ct.is-hold.ct--nc .ct__bars::after {
	background: #a78bfa;
	box-shadow: 0 0 8px rgba(167, 139, 250, 0.5);
}
.ct.is-hold .ct__tag {
	color: #a78bfa;
}

/* coil + lamp -------------------------------------------------- */

.coil {
	position: relative;
	flex: 0 0 auto;
	width: 46px;
	height: 40px;
	--arc: rgba(148, 140, 200, 0.55);
}
.coil__arc {
	position: absolute;
	top: 50%;
	width: 13px;
	height: 28px;
	border: 2px solid var(--arc);
	transition: 0.2s ease;
}
.coil__arc--l {
	left: 10px;
	transform: translateY(-50%);
	border-right: 0;
	border-radius: 999px 0 0 999px;
}
.coil__arc--r {
	left: 23px;
	transform: translateY(-50%);
	border-left: 0;
	border-radius: 0 999px 999px 0;
}
.coil::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 0;
	width: 10px;
	border-top: 2px solid var(--wire);
}
.coil::after {
	content: "";
	position: absolute;
	top: 50%;
	right: 0;
	left: 36px;
	border-top: 2px solid var(--wire);
}
.coil.is-in {
	--arc: var(--cyan);
}
.coil.is-in .coil__arc {
	box-shadow: 0 0 12px rgba(34, 211, 238, 0.6), inset 0 0 8px rgba(34, 211, 238, 0.35);
}
.coil.is-in .coil__tag {
	color: var(--cyan);
}

.lamp {
	position: relative;
	flex: 0 0 auto;
	width: 52px;
	height: 40px;
	--bulb: rgba(148, 140, 200, 0.4);
}
.lamp::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 0;
	width: 12px;
	border-top: 2px solid var(--wire);
}
.lamp::after {
	content: "";
	position: absolute;
	top: 50%;
	right: 0;
	left: 30px;
	border-top: 2px solid var(--wire);
}
.lamp__bulb {
	position: absolute;
	left: 15px;
	top: 50%;
	transform: translateY(-50%);
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--bulb);
	box-shadow: inset 0 0 0 1.5px rgba(10, 8, 20, 0.6);
	transition: 0.2s ease;
}
.lamp.is-in {
	--bulb: var(--live);
}
.lamp.is-in .lamp__bulb {
	box-shadow: 0 0 14px rgba(163, 230, 53, 0.75), inset 0 0 5px rgba(255, 255, 255, 0.55);
}
.lamp.is-in .lamp__tag {
	color: var(--live);
}
.lamp.is-in::after,
.lamp.is-in::before {
	border-color: rgba(163, 230, 53, 0.5);
}

/* field devices ------------------------------------------------ */

.field {
	padding: 14px 16px;
	border-top: 1px solid var(--line);
	background: rgba(8, 6, 15, 0.35);
}
.field__lbl {
	margin-bottom: 10px;
	font-family: var(--mono);
	font-size: 10px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--fg-4);
}
.field__row {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}
.pb {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 1px;
	min-width: 104px;
	padding: 9px 12px 9px 14px;
	border: 1px solid var(--line-hi);
	border-radius: 10px;
	background: rgba(23, 19, 52, 0.6);
	color: var(--fg-2);
	font-family: var(--mono);
	text-align: left;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: 0.18s ease;
}
.pb b {
	font-size: 11.5px;
	color: var(--fg);
	letter-spacing: 0.05em;
}
.pb span:last-child {
	font-size: 10.5px;
	color: var(--fg-4);
}
.pb__cap {
	position: absolute;
	left: 7px;
	top: 50%;
	transform: translateY(-50%);
	width: 4px;
	height: 26px;
	border-radius: 2px;
	background: var(--cap, var(--fg-4));
	opacity: 0.35;
	transition: 0.18s ease;
}
.pb--go {
	--cap: var(--live);
}
.pb--test {
	--cap: var(--cyan);
}
.pb--estop {
	--cap: #fb7185;
}
.pb--ol {
	--cap: var(--amber);
}
.pb:hover {
	border-color: var(--line-hi);
	background: rgba(34, 29, 74, 0.72);
}
.pb:focus-visible {
	outline: 2px solid var(--cyan);
	outline-offset: 2px;
}
.pb.is-on {
	border-color: var(--cap);
	background: rgba(58, 48, 110, 0.8);
	box-shadow: 0 0 20px -6px var(--cap), inset 0 0 14px -8px var(--cap);
}
.pb.is-on .pb__cap {
	opacity: 1;
	box-shadow: 0 0 10px var(--cap);
}
.pb--estop.is-on {
	background: rgba(120, 26, 46, 0.6);
}

/* output strip -------------------------------------------------- */

.plc__out {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	border-top: 1px solid var(--line);
}
.outro {
	padding: 11px 16px;
	border-right: 1px solid var(--line);
}
.outro:last-child {
	border-right: 0;
}
.outro .k {
	font-family: var(--mono);
	font-size: 9.5px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--fg-4);
}
.outro .v {
	margin-top: 3px;
	font-family: var(--mono);
	font-size: 12px;
	color: var(--fg-2);
	transition: 0.2s ease;
}
.outro .v.is-on {
	color: var(--live);
}
.outro .v.is-hot {
	color: var(--cyan);
}
.outro .v.is-warn {
	color: var(--amber);
}

.plc .verdict {
	margin: 0;
	border: 0;
	border-top: 1px solid var(--line);
	border-radius: 0 0 18px 18px;
	background: rgba(8, 6, 15, 0.4);
}

/* copper trace pattern — the board everything is mounted on */
.pcb {
	position: fixed;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	opacity: 0.42;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='340' height='340' viewBox='0 0 340 340'%3E%3Cg fill='none' stroke='%233b3170' stroke-width='1.3'%3E%3Cpath d='M0 34h92v52h124v-52h124'/%3E%3Cpath d='M0 128h58v62h154V96h128'/%3E%3Cpath d='M0 252h112v-44h88v64h140'/%3E%3Cpath d='M176 0v96'/%3E%3Cpath d='M58 340v-52'/%3E%3Cpath d='M266 190v114'/%3E%3C/g%3E%3Cg fill='%2308060f' stroke='%234a3f86' stroke-width='1.3'%3E%3Ccircle cx='92' cy='34' r='3.4'/%3E%3Ccircle cx='216' cy='34' r='3.4'/%3E%3Ccircle cx='58' cy='190' r='3.4'/%3E%3Ccircle cx='212' cy='96' r='3.4'/%3E%3Ccircle cx='112' cy='208' r='3.4'/%3E%3Ccircle cx='200' cy='272' r='3.4'/%3E%3Ccircle cx='176' cy='96' r='3.4'/%3E%3C/g%3E%3Cg fill='%2334d3ee' opacity='.5'%3E%3Ccircle cx='176' cy='40' r='1.8'/%3E%3Ccircle cx='266' cy='190' r='1.8'/%3E%3Ccircle cx='58' cy='288' r='1.8'/%3E%3C/g%3E%3C/svg%3E");
	background-size: 340px 340px;
	-webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 0%, rgba(0, 0, 0, 0.5) 46%, transparent 82%);
	mask-image: radial-gradient(120% 90% at 50% 0%, #000 0%, rgba(0, 0, 0, 0.5) 46%, transparent 82%);
}

/* ==========================================================================
   bench-02 — three-phase scope
   ========================================================================== */

.bench {
	position: relative;
	margin-top: 18px;
	border: 1px solid var(--line);
	border-radius: 18px;
	background: linear-gradient(180deg, rgba(23, 19, 52, 0.55), rgba(13, 10, 26, 0.8));
	overflow: hidden;
}
.bench .lab__bar {
	border-top: 1px solid var(--line);
}
.scope {
	position: relative;
	padding: 16px 14px 8px;
	background:
		radial-gradient(120% 100% at 50% 0%, rgba(34, 211, 238, 0.05), transparent 62%),
		linear-gradient(180deg, rgba(5, 4, 12, 0.6), rgba(5, 4, 12, 0.2));
}
.scope canvas {
	display: block;
	width: 100%;
	height: 190px;
	border-radius: 10px;
}
.scope__lg {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-top: 8px;
	font-family: var(--mono);
	font-size: 10.5px;
	color: var(--fg-4);
	letter-spacing: 0.06em;
}
.scope__lg .spacer {
	flex: 1;
}
.scope__lg span {
	display: inline-flex;
	align-items: center;
	gap: 5px;
}
.scope__lg i {
	width: 9px;
	height: 2px;
	border-radius: 2px;
	background: var(--c);
	box-shadow: 0 0 7px var(--c);
}
.bench .readouts {
	border-top: 1px solid var(--line);
}
.bench .verdict {
	margin: 0;
	border: 0;
	border-top: 1px solid var(--line);
	border-radius: 0;
	background: rgba(8, 6, 15, 0.4);
}

@media (max-width: 640px) {
	.scope canvas {
		height: 148px;
	}
	.scope__lg {
		gap: 10px;
		font-size: 9.5px;
	}
}

/* ==========================================================================
   reveal
   ========================================================================== */

[data-reveal] {
	opacity: 0;
	transform: translateY(10px);
}

html.reveal-on [data-reveal] {
	transition: opacity 0.55s cubic-bezier(0.22, 0.61, 0.36, 1),
		transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
}

[data-reveal].is-in {
	opacity: 1;
	transform: none;
}

/* ==========================================================================
   responsive
   ========================================================================== */

@media (max-width: 1080px) {
	.lab__grid {
		grid-template-columns: 1fr;
	}
	.lab__ctrl {
		border-right: 0;
		border-bottom: 1px solid var(--line);
	}
}

@media (max-width: 1000px) {
	.sec {
		grid-template-columns: 1fr;
		gap: 30px;
		padding: 68px 0;
	}
	.sec__rail {
		position: static;
	}
	.rig__desk {
		grid-template-columns: 1fr 1fr;
	}
	.rig__slot:nth-child(2) {
		border-right: 0;
	}
	.rig__slot:nth-child(3) {
		border-top: 1px solid var(--line);
		grid-column: 1 / -1;
	}
}

@media (max-width: 900px) {
	.nav {
		display: none;
	}
	.vitals {
		grid-template-columns: 1fr 1fr;
	}
	.hero {
		padding: 66px 0 52px;
	}
	.clocks .local {
		display: none;
	}
}

@media (max-width: 640px) {
	.shell {
		padding: 0 16px;
	}
	html {
		scroll-padding-top: 80px;
	}
	.top__in {
		height: 56px;
		gap: 12px;
	}
	.id__handle {
		display: none;
	}
	.bus__label {
		display: none;
	}
	.clocks .k {
		display: none;
	}
	.hero h1 {
		font-size: clamp(30px, 9.4vw, 44px);
	}
	.hero__lede {
		font-size: 15.5px;
	}
	.sec {
		padding: 54px 0;
	}
	.split,
	.rig__desk {
		grid-template-columns: 1fr;
	}
	.rig__slot {
		border-right: 0;
		border-bottom: 1px solid var(--line);
	}
	.rig__slot:last-child {
		border-bottom: 0;
	}
	.dl {
		grid-template-columns: 1fr;
	}
	.dl dt {
		padding-bottom: 2px;
		border-bottom: 0;
	}
	.dl dd {
		padding-top: 2px;
	}
	.vitals {
		grid-template-columns: 1fr 1fr;
	}
	.vital .v {
		font-size: 18px;
	}
	.readouts {
		grid-template-columns: 1fr 1fr;
	}
	.schem {
		padding: 14px 10px;
		min-height: 0;
	}
	.code {
		max-height: 440px;
		font-size: 12px;
	}
	.row::before {
		width: 34px;
		margin-right: 12px;
	}
	.vw__search input {
		width: 116px;
	}
	.vw__search input:focus {
		width: 150px;
	}
	.hint {
		display: none;
	}
	.ladder {
		padding: 22px 10px 18px;
	}
	.field__row {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 8px;
	}
	.pb {
		min-width: 0;
		padding: 8px 10px 8px 13px;
	}
	.plc__out {
		grid-template-columns: 1fr 1fr;
	}
	.outro:nth-child(2) {
		border-right: 0;
	}
	.outro:nth-child(-n + 2) {
		border-bottom: 1px solid var(--line);
	}
	.ct {
		width: 58px;
	}
	.ct::before,
	.ct::after {
		width: 24px;
	}
	.blob {
		filter: blur(64px);
		opacity: 0.42;
	}
}

@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;
	}
	[data-reveal] {
		opacity: 1;
		transform: none;
	}
	.blob,
	.fx-canvas,
	.pcb,
	.sweep {
		display: none;
	}
}

@media print {
	.blob,
	.fx-canvas,
	.pcb,
	.sweep,
	.progress,
	.top,
	.vw__tools {
		display: none;
	}
	.code {
		max-height: none;
	}
}