@font-face {
	font-family: "Archivo";
	font-style: normal;
	font-weight: 100 900;
	font-stretch: 62% 125%;
	font-display: swap;
	src: url("/fonts/archivo-latin-ext.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: "Archivo";
	font-style: normal;
	font-weight: 100 900;
	font-stretch: 62% 125%;
	font-display: swap;
	src: url("/fonts/archivo-latin.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/*
 * Two states.
 * html.off  – "no IT": browser defaults only (Times, blue links), plus the switch.
 * otherwise – powered: electric yellow poster. Every powered rule is scoped to html:not(.off),
 *             so without JS the powered page shows.
 */

:root {
	--volt: #ffd400;
	--ink: #121417;
	--muted: rgba(18, 20, 23, 0.72);
	--led: #ff8a00;
	--gutter: 20px;
	color-scheme: light;
}

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

html.off,
html.off body {
	background: #fff;
}

.sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* ---------- the switch (both states) ---------- */

.switch {
	display: inline-flex;
	align-items: center;
	gap: 18px;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	user-select: none;
	-webkit-user-select: none;
}

.plate {
	--size: 132px;
	position: relative;
	flex: none;
	width: var(--size);
	height: var(--size);
	border-radius: calc(var(--size) * 0.19);
	background: linear-gradient(#ffffff, #eef1f3);
	border: 1px solid #d3d9de;
	box-shadow:
		inset 0 1px 0 #fff,
		0 2px 3px rgba(18, 20, 23, 0.06),
		0 14px 28px -14px rgba(18, 20, 23, 0.4);
	perspective: 320px;
	view-transition-name: plate;
}

.rocker {
	position: absolute;
	inset: 17%;
	display: grid;
	grid-template-rows: 1fr 1fr;
	justify-items: center;
	align-items: center;
	border-radius: 14px;
	border: 1px solid #cfd5da;
	font: 600 20px/1 "Archivo", system-ui, sans-serif;
	color: #8a939b;
	/* off: the O half (bottom) is pressed in */
	background: linear-gradient(#ffffff 0%, #f6f8f9 48%, #e3e7ea 52%, #d9dee2 100%);
	box-shadow: 0 5px 8px -4px rgba(18, 20, 23, 0.3);
	transform: rotateX(-13deg);
	transition:
		transform 0.14s cubic-bezier(0.3, 1.6, 0.5, 1),
		background 0.14s,
		box-shadow 0.14s;
}

.switch input:checked + .plate .rocker {
	/* on: the I half (top) is pressed in */
	background: linear-gradient(#d9dee2 0%, #e3e7ea 48%, #f6f8f9 52%, #ffffff 100%);
	box-shadow: 0 -5px 8px -4px rgba(18, 20, 23, 0.22);
	transform: rotateX(13deg);
}

.switch input:checked + .plate .rocker .i {
	color: var(--ink);
}

.led {
	position: absolute;
	top: 7%;
	left: 50%;
	width: 7px;
	height: 7px;
	margin-left: -3.5px;
	border-radius: 50%;
	background: #c9cfd4;
	transition:
		background 0.15s,
		box-shadow 0.15s;
}

.switch input:checked + .plate .led {
	background: var(--led);
	box-shadow: 0 0 10px 3px rgba(255, 138, 0, 0.6);
}

.switch input:focus-visible + .plate {
	outline: 3px solid var(--led);
	outline-offset: 4px;
}

/* ---------- off: raw HTML, only layout for the switch ---------- */

html.off .power {
	margin: 28px 0 32px;
}

/* standby light blinks until the switch is flipped */
html.off .led {
	animation: standby 1.4s ease-in-out infinite;
}

@keyframes standby {
	50% {
		background: var(--led);
		box-shadow: 0 0 10px 3px rgba(255, 138, 0, 0.6);
	}
}

/* without IT there is nothing to read yet, only the switch */
html.off .info {
	display: none;
}

/* 1996-style pixel arrow (like an animated GIF) pointing at the switch */
.arrow {
	display: none;
}

.caption-text {
	white-space: pre-line;
}

html.off .caption-text {
	white-space: pre; /* exactly the two lines, never re-wrapped */
}

html.off .switch {
	gap: 12px;
}

html.off .plate {
	--size: 116px;
}

html.off .caption {
	display: flex;
	align-items: center;
	gap: 8px;
	max-width: none;
}

html.off .arrow {
	display: block;
	flex: none;
	image-rendering: pixelated;
	animation: point 0.6s steps(1, end) infinite;
}

@keyframes point {
	50% {
		transform: translateX(-12px);
	}
}

/* ---------- powered: the yellow poster ---------- */

html:not(.off),
html:not(.off) body {
	margin: 0;
	background: var(--volt);
	color: var(--ink);
}

html:not(.off) body {
	font-family: "Archivo", system-ui, sans-serif;
	font-size: 17px;
	line-height: 1.45;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

html:not(.off) ::selection {
	background: var(--ink);
	color: var(--volt);
}

html:not(.off) a {
	color: inherit;
}

html:not(.off) a:focus-visible {
	outline: 3px solid var(--ink);
	outline-offset: 3px;
	border-radius: 2px;
}

html:not(.off) .card {
	min-height: 100svh;
	display: grid;
	grid-template-columns: 1fr;
	grid-template-rows: auto auto 1fr auto;
	grid-template-areas:
		"top"
		"mark"
		"power"
		"info";
	max-width: 1440px;
	margin: 0 auto;
}

html:not(.off) .top {
	grid-area: top;
	display: flex;
	justify-content: flex-end;
	padding: 12px calc(var(--gutter) - 8px) 0;
	font-size: 14px;
	font-weight: 600;
}

html:not(.off) .lang a,
html:not(.off) .lang span {
	display: inline-block;
	padding: 8px;
	text-decoration: none;
}

html:not(.off) .lang a {
	color: var(--muted);
}

html:not(.off) .lang span {
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 4px;
}

html:not(.off) .mark {
	grid-area: mark;
	margin: 0 0 0 -0.04em;
	padding: 0 var(--gutter);
	font-stretch: 62%;
	font-weight: 900;
	/* "Power" is ~2.16em wide; fit it inside the gutters */
	font-size: min(calc((100vw - 2 * var(--gutter)) / 2.2), 26svh);
	line-height: 0.78;
	letter-spacing: -0.025em;
}

html:not(.off) .mark .word {
	display: block;
	white-space: nowrap;
}

html:not(.off) .power {
	grid-area: power;
	display: flex;
	align-items: center;
	padding: 20px var(--gutter);
}

html:not(.off) .plate {
	--size: 112px;
	border-color: rgba(18, 20, 23, 0.15);
	box-shadow:
		inset 0 1px 0 #fff,
		0 2px 3px rgba(18, 20, 23, 0.1),
		0 16px 30px -12px rgba(120, 90, 0, 0.55);
}

html:not(.off) .caption {
	font-stretch: 75%;
	font-weight: 800;
	font-size: 24px;
	line-height: 1.05;
}

html:not(.off) .info {
	grid-area: info;
	padding: 0 var(--gutter) max(24px, env(safe-area-inset-bottom));
	display: grid;
	gap: 16px;
}

html:not(.off) .tagline {
	margin: 0;
	max-width: 13ch;
	font-stretch: 75%;
	font-weight: 800;
	font-size: clamp(34px, 10vw, 56px);
	line-height: 0.95;
	letter-spacing: -0.01em;
}

html:not(.off) .lead {
	margin: -4px 0 0;
	max-width: 34ch;
	font-size: 16px;
	line-height: 1.4;
	color: var(--muted);
}

html:not(.off) .product {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 16px;
	border-radius: 14px;
	background: #fff;
	text-decoration: none;
	box-shadow: 0 10px 24px -14px rgba(120, 90, 0, 0.6);
}

html:not(.off) .product img {
	height: 20px;
	width: auto;
	flex: none;
}

html:not(.off) .product span {
	font-size: 14px;
	line-height: 1.3;
	color: rgba(18, 20, 23, 0.7);
}

html:not(.off) .mail {
	justify-self: start;
	font-stretch: 85%;
	font-weight: 800;
	font-size: clamp(26px, 7.6vw, 40px);
	line-height: 1;
	letter-spacing: -0.015em;
	text-decoration: underline;
	text-decoration-thickness: 3px;
	text-underline-offset: 0.16em;
}

/* wider screens: wordmark left, text right, switch below the wordmark */
@media (min-width: 900px) {
	html:not(.off) {
		--gutter: 48px;
	}

	html:not(.off) .card {
		grid-template-columns: 1.2fr 1fr;
		grid-template-rows: auto auto 1fr;
		grid-template-areas:
			"top top"
			"mark info"
			"power info";
		column-gap: 48px;
	}

	html:not(.off) .top {
		padding-top: 24px;
	}

	html:not(.off) .mark {
		margin-left: 0;
		padding-top: 24px;
		font-size: min(21vw, 36svh, 320px);
	}

	html:not(.off) .power {
		align-items: flex-start;
		padding-top: 40px;
		padding-bottom: 48px;
	}

	html:not(.off) .info {
		grid-row: 2 / 4;
		align-self: center;
		padding-left: 0;
		gap: 22px;
	}

	html:not(.off) .lead {
		font-size: 19px;
	}
}

/* ---------- power on: tube flicker on each letter ---------- */

.mark .ch {
	display: inline-block;
}

html.powering .mark .ch {
	animation: tube-start 0.75s steps(1, end) both;
	animation-delay: var(--d, 0s);
}

@keyframes tube-start {
	0% { opacity: 0; }
	12% { opacity: 1; }
	18% { opacity: 0.15; }
	30% { opacity: 1; }
	36% { opacity: 0.35; }
	44% { opacity: 1; }
	100% { opacity: 1; }
}

/* now and then one tired tube flickers */
html:not(.off) .mark .ch.blip {
	animation: blip 0.5s steps(1, end);
}

@keyframes blip {
	0% { opacity: 1; }
	20% { opacity: 0.2; }
	30% { opacity: 1; }
	55% { opacity: 0.45; }
	65% { opacity: 1; }
}

/* ---------- surge: yellow floods out of the switch (View Transitions) ---------- */

::view-transition-old(root),
::view-transition-new(root) {
	animation: none;
	mix-blend-mode: normal;
}

html.surge-on::view-transition-new(root) {
	animation: surge 0.62s cubic-bezier(0.65, 0, 0.35, 1) both;
}

html.surge-off::view-transition-old(root) {
	z-index: 1;
	animation: surge 0.45s cubic-bezier(0.65, 0, 0.35, 1) reverse both;
}

@keyframes surge {
	from {
		clip-path: circle(0 at var(--sx, 50%) var(--sy, 50%));
	}
	to {
		clip-path: circle(var(--sr, 150%) at var(--sx, 50%) var(--sy, 50%));
	}
}

::view-transition-group(plate) {
	z-index: 2;
	animation-duration: 0.62s;
	animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1);
}

/* reduced motion: no surge, no flashing. The page fades in and the letters light up one by one. */
@media (prefers-reduced-motion: reduce) {
	.rocker,
	.led {
		transition: none;
	}

	html.off .led,
	html.off .arrow {
		animation: none;
	}

	html.off .led {
		background: var(--led);
	}

	html.surge-on::view-transition-new(root) {
		animation: fade-in 0.4s ease both;
	}

	html.surge-off::view-transition-old(root) {
		animation: fade-in 0.3s ease reverse both;
	}

	::view-transition-group(plate) {
		animation-duration: 0.4s;
	}

	html.powering .mark .ch {
		animation: fade-in 0.35s ease both;
		animation-delay: var(--d, 0s);
	}

	html:not(.off) .mark .ch.blip {
		animation: none;
	}
}

@keyframes fade-in {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}
