@font-face {
	font-family: "Pixelify Sans";
	src: url("/fonts/pixelify-sans-latin.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

:root {
	--blue: #143c96;
	--ink: #fff;
	--line: #fff;
	--sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
	--mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
	--pixel: "Pixelify Sans", var(--mono);

	/* Where the glass of the monitor sits inside its plastic case. */
	--vh: 100vh;
	--glass-x: clamp(14px, 7vw, 120px);
	--glass-top: clamp(12px, 6.5vh, 66px);
	--glass-bottom: clamp(12px, 8.5vh, 84px);
	--glass-radius: clamp(18px, 5vw, 76px) / clamp(22px, 8vh, 92px);

	/* The colour of the tube. The channel dial swaps these. */
	--tube-a: #2a66cf;
	--tube-b: #174aa8;
	--tube-c: #0b2a6b;
}

[data-channel="green"] {
	--tube-a: #2f9c55;
	--tube-b: #1b7239;
	--tube-c: #0a3a1b;
}

[data-channel="amber"] {
	--tube-a: #cf8a2c;
	--tube-b: #a3631a;
	--tube-c: #56300a;
}

[data-channel="mono"] {
	--tube-a: #8b8d90;
	--tube-b: #5d5f62;
	--tube-c: #2a2b2d;
}

@supports (height: 100dvh) {
	:root {
		--vh: 100dvh;
	}
}

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

html,
body {
	height: 100%;
	margin: 0;
	background: #000;
	color: var(--ink);
}

body {
	font-family: var(--sans);
	font-size: 16px;
	line-height: 1.45;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow: hidden;
}

/* The monitor is drawn, not photographed: a plastic case with a nameplate and
   dials, a dark inner frame, and a curved blue tube with scanlines and a glare. */
.monitor {
	position: fixed;
	inset: 0;
	pointer-events: none;
	background:
		linear-gradient(180deg, rgb(255 255 255 / 0.22), transparent 14%, transparent 82%, rgb(0 0 0 / 0.28)),
		radial-gradient(130% 120% at 50% 42%, #d8c7a0 0%, #c4b084 52%, #8d7a55 100%);
}

/* Nameplate, pressed into the plastic under the screen. */
.monitor::before {
	content: "AGENT-TO-AGENT \00b7 MODEL 2026";
	position: absolute;
	left: calc(var(--glass-x) + 20px);
	bottom: calc(var(--glass-bottom) / 2 - 8px);
	font-family: var(--pixel);
	font-size: 15px;
	line-height: 1;
	letter-spacing: 0.06em;
	color: rgb(70 54 28 / 0.62);
	text-shadow: 0 1px 0 rgb(255 255 255 / 0.35);
}

/* A string of pixel lights across the top of the case. */
.lights {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: var(--glass-top);
	background: linear-gradient(#3b3222, #3b3222) 0 calc(50% - 9px) / 100% 2px no-repeat;
}

.lights::before,
.lights::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: calc(50% - 7px);
	height: 10px;
	background-repeat: repeat-x;
	background-size: 120px 10px;
	filter: drop-shadow(0 0 5px rgb(255 244 210 / 0.8));
}

.lights::before {
	background-image: linear-gradient(90deg, transparent 0 10px, #ff4d5e 10px 20px, transparent 20px 70px, #3ddc84 70px 80px, transparent 80px);
}

.lights::after {
	background-image: linear-gradient(90deg, transparent 0 40px, #ffd34d 40px 50px, transparent 50px 100px, #5ab0ff 100px 110px, transparent 110px);
}

.glass {
	position: absolute;
	top: var(--glass-top);
	bottom: var(--glass-bottom);
	left: var(--glass-x);
	right: var(--glass-x);
	border-radius: var(--glass-radius);
	overflow: hidden;
	background: #04060c;
	box-shadow:
		0 0 0 clamp(6px, 1vw, 14px) #0d0d0f,
		0 0 0 calc(clamp(6px, 1vw, 14px) + 2px) rgb(255 255 255 / 0.14),
		0 0 46px clamp(10px, 2vw, 26px) rgb(0 0 0 / 0.5);
}

/* The lit picture, separate from the glass so it can power on. */
.picture {
	position: absolute;
	inset: 0;
	background: radial-gradient(ellipse 85% 80% at 50% 42%, var(--tube-a) 0%, var(--tube-b) 46%, var(--tube-c) 100%);
	box-shadow: inset 0 0 clamp(40px, 9vw, 150px) rgb(0 0 0 / 0.62);
}

.picture::before {
	content: "";
	position: absolute;
	inset: 0;
	background: repeating-linear-gradient(to bottom, rgb(255 255 255 / 0.045) 0 1px, transparent 1px 3px);
}

.picture::after {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(ellipse 55% 38% at 22% 12%, rgb(255 255 255 / 0.16), transparent 70%);
}

/* A soft band that rolls down the screen, like a camera filming a CRT. */
.roll {
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	height: 24%;
	background: linear-gradient(to bottom, transparent, rgb(255 255 255 / 0.06) 45%, rgb(255 255 255 / 0.06) 55%, transparent);
	transform: translateY(-110%);
}

/* The controls on the case. They work: channel, snow, power. */
.controls {
	position: fixed;
	right: calc(var(--glass-x) + 18px);
	bottom: calc(var(--glass-bottom) / 2 - 9px);
	display: flex;
	align-items: center;
	gap: 12px;
}

.controls button {
	appearance: none;
	margin: 0;
	padding: 0;
	border: 0;
	cursor: pointer;
}

.dial {
	position: relative;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: radial-gradient(circle at 35% 30%, #75664a, #2e271a 72%);
	box-shadow: 0 1px 0 rgb(255 255 255 / 0.3);
	transition: transform 160ms ease-out;
}

.dial::after {
	content: "";
	position: absolute;
	left: calc(50% - 1px);
	top: 2px;
	width: 2px;
	height: 6px;
	background: rgb(255 255 255 / 0.55);
}

.led {
	position: relative;
	width: 18px;
	height: 18px;
	background: none;
}

.led::after {
	content: "";
	position: absolute;
	inset: 4.5px;
	background: #7dff9a;
	box-shadow: 0 0 10px 2px rgb(125 255 154 / 0.7);
}

/* Channel and snow readouts, top right of the picture like a TV's. */
.osd {
	position: fixed;
	top: calc(var(--glass-top) + clamp(16px, 4vh, 34px));
	right: calc(var(--glass-x) + clamp(18px, 4vw, 54px));
	margin: 0;
	font-family: var(--pixel);
	font-size: 24px;
	line-height: 1;
	text-transform: uppercase;
	color: #7dff9a;
	text-shadow: 0 0 10px rgb(125 255 154 / 0.7);
	pointer-events: none;
}

/* Closed captions, for the things the screen says back. */
.caption {
	position: fixed;
	left: 50%;
	bottom: calc(var(--glass-bottom) + clamp(58px, 12vh, 104px));
	transform: translateX(-50%);
	width: max-content;
	max-width: min(84vw, 720px);
	margin: 0;
	padding: 6px 12px 7px;
	background: #000;
	font-family: var(--pixel);
	font-size: clamp(16px, 2.2vw, 24px);
	line-height: 1.15;
	text-align: center;
	text-transform: uppercase;
	pointer-events: none;
}

.osd[hidden],
.caption[hidden] {
	display: none;
}

/* Powered off: a dark tube and a red standby light. */
.off .picture {
	opacity: 0;
}

.off .tube,
.off .snow,
.off .osd,
.off .caption {
	visibility: hidden;
	animation: none;
}

.off .led::after {
	background: #b3382f;
	box-shadow: none;
	animation: none;
}

/* Everything readable lives inside the glass and scrolls there. */
.tube,
.snow {
	position: fixed;
	top: var(--glass-top);
	bottom: var(--glass-bottom);
	left: var(--glass-x);
	right: var(--glass-x);
	border-radius: var(--glass-radius);
}

.tube {
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: rgb(255 255 255 / 0.5) transparent;
	-webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 26px, #000 calc(100% - 26px), transparent 100%);
	mask-image: linear-gradient(to bottom, transparent 0, #000 26px, #000 calc(100% - 26px), transparent 100%);
}

.screen {
	min-height: 100%;
	max-width: 780px;
	margin: 0 auto;
	padding: clamp(28px, 6.5vh, 64px) clamp(6px, 2vw, 24px) 30px;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.mark {
	margin: 0;
	display: flex;
	align-items: center;
	gap: 10px;
	flex: none;
	font-family: var(--pixel);
	font-size: clamp(20px, 3vh, 26px);
	line-height: 1;
	letter-spacing: -0.02em;
	text-transform: uppercase;
}

.mark svg {
	display: block;
	width: 1em;
	height: 1em;
}

h1 {
	margin: auto 0;
	padding: clamp(20px, 5vh, 56px) 0;
	max-width: 15ch;
	font-size: clamp(34px, min(6.4vw, 11vh), 92px);
	font-weight: 300;
	line-height: 0.98;
	letter-spacing: -0.035em;
	text-transform: uppercase;
	text-wrap: balance;
	text-shadow:
		0 0 22px rgb(150 195 255 / 0.55),
		-1.5px 0 rgb(255 70 100 / 0.32),
		1.5px 0 rgb(70 225 255 / 0.32);
}

/* While the headline types, the part not yet typed is laid out but invisible,
   so the line breaks never move. */
.rest {
	color: transparent;
	text-shadow: none;
}

/* The block cursor rides straight after the last typed letter. It sits on the
   baseline at cap height, and its margins cancel its width so it takes no room. */
.typed::after {
	content: "";
	display: inline-block;
	width: 0.46em;
	height: 0.72em;
	margin: 0 -0.53em 0 0.07em;
	vertical-align: baseline;
	background: var(--ink);
	box-shadow: 0 0 16px rgb(160 200 255 / 0.75);
}

.mark,
.foot {
	text-shadow: 0 0 10px rgb(150 195 255 / 0.5);
}

/* The scoreboard: which agents have called so far. */
.tally {
	max-width: 46ch;
	margin: 0 0 6px;
	font-family: var(--pixel);
	font-size: clamp(15px, 1.9vw, 20px);
	line-height: 1.25;
	text-transform: uppercase;
	color: #7dff9a;
	text-shadow: 0 0 10px rgb(125 255 154 / 0.6);
	text-wrap: balance;
}

.tally[hidden] {
	display: none;
}

.closed-note {
	margin: 16px 0 0;
	padding: 6px 12px 7px;
	background: #000;
	font-family: var(--pixel);
	font-size: clamp(15px, 2vw, 20px);
	line-height: 1.2;
	text-transform: uppercase;
}

.foot {
	width: 100%;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px 24px;
	margin-top: auto;
	padding-top: 22px;
	font-size: 12px;
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: 0.01em;
	text-transform: uppercase;
	opacity: 0.9;
}

.foot p {
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 6px 8px;
}

.endpoint {
	appearance: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	cursor: pointer;
	text-align: left;
}

.endpoint code {
	font-family: var(--mono);
	font-size: 12px;
	text-transform: none;
	overflow-wrap: anywhere;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

.copied {
	font-family: var(--pixel);
	font-size: 15px;
	line-height: 1;
	padding: 2px 6px 3px;
	background: #000;
}

.copied[hidden] {
	display: none;
}

a {
	color: inherit;
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
}

.status {
	position: fixed;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Pixel snow, falling inside the glass. */
.snow {
	overflow: hidden;
	pointer-events: none;
}

.flake {
	position: absolute;
	top: -10px;
	background: #fff;
	animation: fall linear infinite;
	will-change: transform;
}

/* Gift storm: the flakes become presents. */
.flake.gift {
	top: -24px;
	background: none;
	font-size: 18px;
	font-style: normal;
	line-height: 1;
}

.mark svg {
	cursor: pointer;
}

@keyframes fall {
	to {
		transform: translate3d(var(--drift, 0), calc(var(--vh) + 20px), 0);
	}
}

@keyframes power-on {
	0% {
		transform: scale(0.5, 0.006);
		filter: brightness(7) saturate(0.2);
	}
	40% {
		transform: scale(1, 0.006);
		filter: brightness(7) saturate(0.2);
	}
	100% {
		transform: none;
		filter: none;
	}
}

@keyframes power-off {
	55% {
		transform: scale(1, 0.006);
		filter: brightness(6) saturate(0.2);
		opacity: 1;
	}
	85% {
		transform: scale(0.01, 0.006);
		filter: brightness(8);
		opacity: 1;
	}
	100% {
		transform: scale(0, 0);
		opacity: 0;
	}
}

@keyframes appear {
	from {
		opacity: 0;
	}
}

@keyframes roll {
	to {
		transform: translateY(520%);
	}
}

@keyframes flicker {
	93% {
		opacity: 1;
	}
	94% {
		opacity: 0.93;
	}
	95% {
		opacity: 1;
	}
	97% {
		opacity: 0.96;
	}
	98% {
		opacity: 1;
	}
}

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

@keyframes twinkle {
	50% {
		opacity: 0.28;
	}
}

@keyframes turn {
	to {
		transform: rotate(360deg);
	}
}

@keyframes pulse {
	50% {
		opacity: 0.7;
		box-shadow: 0 0 4px 1px rgb(125 255 154 / 0.4);
	}
}

@media (prefers-reduced-motion: no-preference) {
	.picture {
		animation:
			power-on 800ms cubic-bezier(0.2, 0.8, 0.2, 1) both,
			flicker 7s 2s linear infinite;
	}

	.tube,
	.snow {
		animation: appear 600ms 700ms both;
	}

	.roll {
		animation: roll 9s 1.5s linear infinite;
	}

	.typed::after {
		animation: blink 1.06s steps(1) infinite;
	}

	.lights::before {
		animation: twinkle 1.8s steps(1) infinite;
	}

	.lights::after {
		animation: twinkle 1.8s -0.9s steps(1) infinite;
	}

	.mark svg {
		animation: turn 6s steps(8) infinite;
	}

	.led::after {
		animation: pulse 2.4s ease-in-out infinite;
	}

	.off .picture {
		opacity: 1;
		animation: power-off 480ms cubic-bezier(0.4, 0, 1, 1) forwards;
	}

	/* Blizzard mode: the lights lose their composure. */
	.party .lights::before {
		animation: twinkle 0.3s steps(1) infinite;
	}

	.party .lights::after {
		animation: twinkle 0.3s -0.15s steps(1) infinite;
	}
}

@media (prefers-reduced-motion: reduce) {
	.snow {
		display: none;
	}
}

/* Too little case showing to hold the trim. */
@media (max-height: 480px) {
	.lights,
	.controls,
	.monitor::before {
		display: none;
	}
}

@media (max-width: 640px) {
	.monitor::before {
		content: "A2A \00b7 2026";
	}

	.foot {
		justify-content: center;
		text-align: center;
	}

	.endpoint {
		text-align: center;
	}
}
