/*
 * Max Gruber — CRT experience
 *
 * Layer order (z-index):
 *   1   content
 *   40  CRT artefacts (scanlines, grain, roll, flicker, glare, vignette)
 *   60  clock, sitting on the glass as a separate physical object
 *   200 power-on overlay
 *
 * Only transform, opacity and filter are ever animated.
 */

/* ------------------------------------------------------------------ tokens */

:root {
	--mg-black: #050505;
	--mg-ink: #f2f4f8;
	--mg-blue: rgb(4, 107, 210);
	--mg-violet: #7d63ff;
	--mg-led: #ff8a12;

	--mg-sans: 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--mg-display: 'Dela Gothic One', 'Roboto', system-ui, sans-serif;

	--mg-ease: cubic-bezier(0.22, 1, 0.36, 1);
	--mg-gutter: clamp(18px, 4vw, 64px);
}

/* -------------------------------------------------------------------- base */

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

html.mg-html {
	background: var(--mg-black);
	scrollbar-gutter: stable;
	-webkit-text-size-adjust: 100%;
	overflow-x: clip;
}

html.mg-locked {
	overflow: hidden;
}

body.mg {
	margin: 0;
	background: var(--mg-black);
	color: var(--mg-ink);
	font-family: var(--mg-sans);
	font-weight: 400;
	font-synthesis: none;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
}

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

.mg-main {
	position: relative;
	z-index: 1;
	overflow-x: clip;
}

.mg-pointer {
	display: none;
}

@media (hover: hover) and (pointer: fine) {
	html.mg-html,
	html.mg-html *,
	body.mg,
	body.mg * {
		cursor: none !important;
	}

	.mg-pointer {
		display: block;
		position: fixed;
		top: 0;
		left: 0;
		z-index: 80;
		width: 5px;
		height: 5px;
		border: 0;
		border-radius: 50%;
		background: #f4fbff;
		box-shadow:
			0 0 3px 1px rgba(255, 255, 255, 1),
			0 0 10px 4px rgba(190, 225, 255, 0.95),
			0 0 22px 8px rgba(4, 107, 210, 0.95),
			0 0 48px 16px rgba(4, 107, 210, 0.7),
			0 0 90px 22px rgba(4, 107, 210, 0.45);
		pointer-events: none;
		opacity: 0;
		will-change: transform;
	}

	.mg-pointer.is-on {
		opacity: 1;
	}
}

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

/* --------------------------------------------------------------- crt glass */

.mg-crt {
	position: fixed;
	inset: 0;
	z-index: 40;
	pointer-events: none;
	contain: strict;
}

.mg-crt > * {
	position: absolute;
	inset: 0;
}

/* Phosphor line structure. Static, so it is painted once. */
.mg-crt__scan {
	background: repeating-linear-gradient(
		to bottom,
		rgba(0, 0, 0, 0.42) 0 1px,
		rgba(0, 0, 0, 0) 1px 3px
	);
	opacity: 0.55;
}

/*
 * Film grain: white speckle on transparency, so it adds light instead of
 * lifting the blacks. Moved in discrete steps, which stays on the compositor.
 */
.mg-crt__grain {
	inset: -160px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0.9 0 0 0 -0.44'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
	background-size: 200px 200px;
	opacity: 0.17;
	animation: mg-grain 0.9s steps(1, end) infinite;
	will-change: transform;
}

@keyframes mg-grain {
	0%   { transform: translate3d(0, 0, 0); }
	12%  { transform: translate3d(-14px, 9px, 0); }
	25%  { transform: translate3d(11px, -13px, 0); }
	37%  { transform: translate3d(-9px, -7px, 0); }
	50%  { transform: translate3d(13px, 12px, 0); }
	62%  { transform: translate3d(-12px, 4px, 0); }
	75%  { transform: translate3d(7px, -11px, 0); }
	87%  { transform: translate3d(-5px, 14px, 0); }
	100% { transform: translate3d(0, 0, 0); }
}

/* Tracking band drifting down the tube. */
.mg-crt__roll {
	inset: auto 0 auto 0;
	height: 46vh;
	background: linear-gradient(
		to bottom,
		transparent,
		rgba(150, 180, 255, 0.03) 34%,
		rgba(230, 240, 255, 0.052) 52%,
		rgba(150, 180, 255, 0.026) 68%,
		transparent
	);
	animation: mg-roll 14s linear infinite;
	will-change: transform;
}

@keyframes mg-roll {
	from { transform: translate3d(0, -50vh, 0); }
	to   { transform: translate3d(0, 105vh, 0); }
}

/* Unstable supply voltage. Long period, barely there. */
.mg-crt__flicker {
	background: #d4e2ff;
	opacity: 0;
	animation: mg-flicker 13s linear infinite;
}

@keyframes mg-flicker {
	0%, 96.2%, 100% { opacity: 0; }
	96.6% { opacity: 0.030; }
	96.9% { opacity: 0; }
	97.7% { opacity: 0.017; }
	98.0% { opacity: 0; }
	98.7% { opacity: 0.024; }
	99.0% { opacity: 0; }
}

.mg-crt__glare {
	background: radial-gradient(115% 78% at 20% 6%, rgba(190, 215, 255, 0.055), transparent 58%);
}

.mg-crt__vignette {
	background: radial-gradient(
		132% 106% at 50% 50%,
		transparent 50%,
		rgba(0, 0, 0, 0.5) 86%,
		rgba(0, 0, 0, 0.88) 100%
	);
	box-shadow: inset 0 0 clamp(60px, 9vw, 160px) rgba(0, 0, 0, 0.75);
}

/* ------------------------------------------------------------------- power */

.mg-boot {
	position: fixed;
	inset: 0;
	z-index: 200;
	pointer-events: none;
	opacity: 0;
	visibility: hidden;
}

.mg-boot > * {
	position: absolute;
	inset: 0;
}

.mg-boot__veil {
	background: #000;
}

.mg-boot__flash {
	background: #e8f1ff;
	opacity: 0;
}

.mg-boot__beam {
	inset: 50% 0 auto 0;
	height: 2px;
	margin-top: -1px;
	background: #fff;
	box-shadow: 0 0 26px 7px rgba(205, 228, 255, 0.85);
	transform: scaleX(0);
	opacity: 0;
}

.is-booting .mg-boot {
	opacity: 1;
	visibility: visible;
	animation: mg-boot-out 1250ms linear forwards;
}

.is-booting .mg-boot__veil {
	animation: mg-boot-veil 1250ms linear forwards;
}

.is-booting .mg-boot__flash {
	animation: mg-boot-flash 1250ms linear forwards;
}

.is-booting .mg-boot__beam {
	animation: mg-boot-beam 1250ms cubic-bezier(0.2, 0.85, 0.25, 1) forwards;
}

@keyframes mg-boot-out {
	0%, 88% { visibility: visible; }
	100%    { visibility: hidden; }
}

@keyframes mg-boot-veil {
	0%, 34% { opacity: 1; }
	50%     { opacity: 0; }
	65%     { opacity: 0; }
	66.5%   { opacity: 0.5; }
	68%     { opacity: 0; }
	78%     { opacity: 0; }
	79.5%   { opacity: 0.28; }
	81%     { opacity: 0; }
	100%    { opacity: 0; }
}

@keyframes mg-boot-flash {
	0%, 32% { opacity: 0; }
	40%     { opacity: 0.5; }
	62%     { opacity: 0; }
	100%    { opacity: 0; }
}

@keyframes mg-boot-beam {
	0%   { transform: scaleX(0) scaleY(1); opacity: 0; }
	10%  { opacity: 1; }
	30%  { transform: scaleX(1) scaleY(1); opacity: 1; }
	38%  { transform: scaleX(1) scaleY(1); opacity: 1; }
	54%  { transform: scaleX(1) scaleY(14); opacity: 0.3; }
	62%  { transform: scaleX(1) scaleY(30); opacity: 0; }
	100% { transform: scaleX(1) scaleY(30); opacity: 0; }
}

/* ------------------------------------------------------------------- clock */

.mg-clock {
	position: fixed;
	z-index: 60;
	top: clamp(14px, 2.6vh, 32px);
	right: clamp(14px, 2.4vw, 40px);
	pointer-events: none;
	user-select: none;
	text-decoration: none;
	color: inherit;
}

a.mg-clock {
	pointer-events: auto;
}

body.admin-bar .mg-clock {
	top: calc(32px + clamp(14px, 2.6vh, 32px));
}

/* Soft housing so the display stays readable when it passes over photography. */
.mg-clock::before {
	content: '';
	position: absolute;
	inset: -70% -34%;
	background: radial-gradient(58% 58% at 50% 50%, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.32) 62%, transparent 78%);
	z-index: -1;
}

.mg-clock__face {
	transform: skewX(-5deg);
	filter: drop-shadow(0 0 4px rgba(255, 138, 18, 0.6)) drop-shadow(0 0 15px rgba(255, 86, 0, 0.4));
}

.mg-clock__time {
	display: flex;
	align-items: flex-end;
	gap: 0.1em;
	font-size: clamp(24px, 3.2vw, 44px);
	line-height: 1;
}

.mg-digit {
	display: block;
	height: 1em;
	width: calc(1em * 100 / 180);
	overflow: visible;
}

.mg-digit polygon {
	fill: var(--mg-led);
	opacity: 0.05;
}

.mg-digit[data-d="0"] :is(.s-a, .s-b, .s-c, .s-d, .s-e, .s-f),
.mg-digit[data-d="1"] :is(.s-b, .s-c),
.mg-digit[data-d="2"] :is(.s-a, .s-b, .s-g, .s-e, .s-d),
.mg-digit[data-d="3"] :is(.s-a, .s-b, .s-g, .s-c, .s-d),
.mg-digit[data-d="4"] :is(.s-f, .s-g, .s-b, .s-c),
.mg-digit[data-d="5"] :is(.s-a, .s-f, .s-g, .s-c, .s-d),
.mg-digit[data-d="6"] :is(.s-a, .s-f, .s-g, .s-e, .s-c, .s-d),
.mg-digit[data-d="7"] :is(.s-a, .s-b, .s-c),
.mg-digit[data-d="8"] :is(.s-a, .s-b, .s-c, .s-d, .s-e, .s-f, .s-g),
.mg-digit[data-d="9"] :is(.s-a, .s-b, .s-c, .s-d, .s-f, .s-g) {
	opacity: 1;
}

.mg-clock__colon {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 0.3em;
	height: 1em;
	padding: 0 0.06em;
	animation: mg-colon 1s steps(1, end) infinite;
}

.mg-clock__colon i {
	display: block;
	width: 0.11em;
	height: 0.11em;
	background: var(--mg-led);
}

@keyframes mg-colon {
	0%, 49.9%  { opacity: 1; }
	50%, 100%  { opacity: 0.16; }
}

.mg-clock__seconds {
	display: flex;
	align-items: flex-end;
	gap: 0.08em;
	font-size: 0.46em;
	margin-left: 0.3em;
	padding-bottom: 0.12em;
}

.mg-clock__date {
	margin-top: 0.7em;
	text-align: right;
	font-size: clamp(9px, 0.82vw, 11px);
	font-weight: 600;
	letter-spacing: 0.26em;
	text-indent: 0.26em;
	color: rgba(255, 145, 30, 0.85);
	text-shadow: 0 0 9px rgba(255, 100, 0, 0.55);
	min-height: 1em;
}

/* ------------------------------------------------------- motion primitives */

.mg-slot {
	position: relative;
}

.mg-move {
	will-change: transform;
}

.mg-reveal {
	opacity: 0;
	transform: scaleY(0.93);
	transition: opacity 0.75s var(--mg-ease), transform 0.95s var(--mg-ease);
}

.mg-reveal.is-in {
	opacity: 1;
	transform: none;
}

/* --------------------------------------------------------------- the media */

.mg-media {
	position: relative;
	margin: 0;
	aspect-ratio: var(--mg-ar, 1);
	overflow: hidden;
	background: #0a0a0c;
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.055), 0 0 70px -22px rgba(4, 107, 210, 0.6);
}

.mg-media img,
.mg-media video {
	width: 100%;
	height: 100%;
	/* The frame carries the native ratio, so nothing is ever cropped. */
	object-fit: cover;
	pointer-events: none;
	user-select: none;
	-webkit-user-drag: none;
}

.mg-media--tube {
	border-radius: clamp(3px, 0.5vw, 9px);
	box-shadow:
		0 0 0 1px rgba(255, 255, 255, 0.1),
		0 0 100px -22px rgba(4, 107, 210, 0.8),
		0 0 160px -40px rgba(125, 99, 255, 0.5);
}

.mg-media--tube::after {
	content: '';
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: radial-gradient(110% 80% at 26% 4%, rgba(215, 232, 255, 0.11), transparent 56%);
}

/* ------------------------------------------------------------------- intro */

.mg-intro {
	position: relative;
	min-height: 100svh;
}

.mg-intro__stage {
	position: relative;
	min-height: 100svh;
}

.mg-slot--mark {
	position: absolute;
	left: -2%;
	top: 43%;
	width: 66%;
	transform: translateY(-50%);
}

.mg-slot--mark::before {
	content: '';
	position: absolute;
	left: -18%;
	top: -46%;
	width: 136%;
	height: 192%;
	background: radial-gradient(46% 46% at 48% 50%, rgba(4, 107, 210, 0.34), rgba(125, 99, 255, 0.12) 62%, transparent 78%);
	pointer-events: none;
}

.mg-logo {
	display: block;
	color: #fff;
}

.mg-logo svg {
	width: 100%;
	height: auto;
}

.mg-logo svg polygon,
.mg-logo svg path {
	fill: currentColor;
}

.mg-logo--mark {
	filter: drop-shadow(0 0 14px rgba(150, 185, 255, 0.3));
}

/* Logo is already in its final seat; the tube warms it into view. */
.is-booting .mg-logo--mark {
	animation: mg-boot-logo 1250ms ease-out forwards;
}

@keyframes mg-boot-logo {
	0%, 28% {
		opacity: 0;
		filter: drop-shadow(0 0 0 transparent);
	}
	46% {
		opacity: 1;
		filter: drop-shadow(0 0 42px rgba(190, 220, 255, 0.95));
	}
	100% {
		opacity: 1;
		filter: drop-shadow(0 0 14px rgba(150, 185, 255, 0.3));
	}
}

.mg-slot--line {
	position: absolute;
	right: var(--mg-gutter);
	bottom: clamp(78px, 15vh, 165px);
	max-width: min(560px, 82vw);
}

.mg-line {
	margin: 0;
	font-size: clamp(0.95rem, 1.45vw, 1.4rem);
	font-weight: 400;
	letter-spacing: 0.045em;
	line-height: 1.3;
	color: #eef2ff;
	white-space: nowrap;
	text-shadow:
		-0.014em 0 0 rgba(255, 40, 90, 0.34),
		0.014em 0 0 rgba(4, 107, 210, 0.42),
		0 0 0.6em rgba(150, 185, 255, 0.34);
}

.mg-line__prompt {
	color: var(--mg-blue);
	margin-right: 0.5em;
	text-shadow: 0 0 0.7em rgba(4, 107, 210, 0.85);
}

.mg-caret {
	display: inline-block;
	width: 0.5em;
	height: 1.05em;
	margin-left: 0.12em;
	vertical-align: -0.18em;
	background: currentColor;
	box-shadow: 0 0 0.7em rgba(180, 205, 255, 0.6);
	animation: mg-caret 1.06s steps(1, end) infinite;
}

@keyframes mg-caret {
	0%, 49.9% { opacity: 1; }
	50%, 100% { opacity: 0; }
}

/* Wordless scroll cue: a signal travelling down a hairline. */
.mg-scrollcue {
	position: absolute;
	left: 50%;
	bottom: clamp(22px, 4vh, 46px);
	width: 1px;
	height: clamp(38px, 6vh, 66px);
	background: rgba(255, 255, 255, 0.14);
	overflow: hidden;
	transition: opacity 0.5s linear;
}

.mg-scrollcue i {
	position: absolute;
	inset: 0 0 auto 0;
	height: 40%;
	background: linear-gradient(to bottom, transparent, var(--mg-blue));
	animation: mg-cue 2.4s var(--mg-ease) infinite;
}

@keyframes mg-cue {
	0%       { transform: translateY(-100%); }
	65%, 100% { transform: translateY(250%); }
}

.mg-intro.is-past .mg-scrollcue {
	opacity: 0;
}

/* ------------------------------------------------------------- editorial 1 */

.mg-shoot {
	position: relative;
}

.mg-e1-hold {
	position: relative;
	height: 260vh;
}

.mg-e1-hold__stage {
	position: sticky;
	top: 0;
	height: 100svh;
	overflow: clip;
}

body.admin-bar .mg-e1-hold__stage {
	top: 32px;
	height: calc(100svh - 32px);
}

.mg-slot--title {
	position: absolute;
	left: 50%;
	top: 30%;
	width: 100vw;
	transform: translate(-50%, -50%);
	z-index: 1;
}

.mg-title {
	margin: 0;
	font-family: var(--mg-display);
	font-weight: 400;
	font-size: clamp(2.7rem, 10.3vw, 9.6rem);
	line-height: 0.86;
	letter-spacing: -0.02em;
	text-transform: uppercase;
	text-align: center;
	white-space: nowrap;
	color: #f6f8ff;
	will-change: transform;
	text-shadow:
		-0.016em 0 0 rgba(255, 36, 84, 0.3),
		0.016em 0 0 rgba(4, 107, 210, 0.42),
		0 0 0.3em rgba(160, 190, 255, 0.2),
		0 0 1.1em rgba(4, 107, 210, 0.22);
}

.mg-slot--tape {
	position: absolute;
	right: 6%;
	top: 65%;
	height: 54svh;
	transform: translateY(-50%);
	z-index: 3;
}

.mg-slot--tape .mg-move,
.mg-slot--tape .mg-media {
	height: 100%;
	width: auto;
}

.mg-slot--chair {
	position: absolute;
	left: -1.5%;
	top: 64%;
	width: 17vw;
	z-index: 2;
}

.mg-e1-spread {
	position: relative;
	padding: 18vh 0 20vh;
}

.mg-slot--scaffold {
	width: 31vw;
	margin-left: 9vw;
}

.mg-slot--wall {
	width: 27vw;
	margin-left: auto;
	margin-right: 8vw;
	margin-top: -26vh;
}

.mg-e1-close {
	position: relative;
	padding: 4vh 0 26vh;
	overflow-x: clip;
}

.mg-e1-close__inner {
	position: relative;
	width: min(1500px, 94vw);
	margin-inline: auto;
	min-height: 58vw;
}

.mg-slot--rider {
	width: 32%;
	margin-left: 6%;
}

.mg-slot--rider .mg-title--yh {
	margin: 0 0 0.35em;
	padding-left: 0;
}

.mg-slot--gallop {
	position: absolute;
	right: -13%;
	bottom: 2%;
	width: 46%;
}

.mg-title--enzo {
	font-size: clamp(1.85rem, 4.6vw, 3.85rem);
}

/* ------------------------------------------------------------------ yee haw */

.mg-yh {
	position: relative;
	padding: 8vh 0 28vh;
	min-height: 0;
}

.mg-slot--yh-title {
	position: relative;
	z-index: 2;
	padding-left: 8vw;
	margin-bottom: clamp(4.5rem, 18vh, 11rem);
}

.mg-title--yh {
	font-size: clamp(2.6rem, 8.4vw, 7.4rem);
	text-align: left;
	word-spacing: 0.12em;
}

.mg-slot--yh-trio {
	width: 38vw;
	margin-left: 10vw;
}

.mg-slot--yh-lean {
	width: 48vw;
	margin-left: auto;
	margin-right: -6vw;
	margin-top: 8vh;
}

/* --------------------------------------------------------------------- drift */

.mg-drift {
	position: relative;
	padding: 10vh 0 22vh;
	min-height: 110svh;
	overflow-x: clip;
}

.mg-slot--drift-field {
	width: 34vw;
	margin-left: 8vw;
}

.mg-slot--drift-close {
	width: 22vw;
	margin-left: auto;
	margin-right: 10vw;
	margin-top: -32vh;
}

.mg-slot--drift-tape {
	position: absolute;
	left: 42%;
	bottom: 8vh;
	height: 28svh;
}

.mg-slot--drift-tape .mg-move,
.mg-slot--drift-tape .mg-media {
	height: 100%;
	width: auto;
}

/* ---------------------------------------------------------------- black swan */

.mg-bs-hold {
	position: relative;
	height: 220vh;
}

.mg-bs-hold__stage {
	position: sticky;
	top: 0;
	height: 100svh;
	overflow: clip;
}

body.admin-bar .mg-bs-hold__stage {
	top: 32px;
	height: calc(100svh - 32px);
}

.mg-slot--bs-title {
	position: absolute;
	left: 50%;
	top: 18%;
	width: 100vw;
	transform: translate(-50%, -50%);
	z-index: 3;
}

.mg-title--bs {
	font-size: clamp(2.2rem, 7.2vw, 6.4rem);
	word-spacing: 0.12em;
}

.mg-slot--bs-swan {
	position: absolute;
	left: 6%;
	top: 50%;
	width: 32vw;
	transform: translateY(-42%);
	z-index: 2;
}

.mg-slot--bs-back {
	position: absolute;
	right: 8%;
	top: 54%;
	width: 28vw;
	transform: translateY(-40%);
	z-index: 2;
}

.mg-bs-after {
	position: relative;
	padding: 12vh 0 22vh;
}

.mg-slot--bs-gaze {
	width: 24vw;
	margin-left: 14vw;
}

.mg-slot--bs-face {
	width: 30vw;
	margin-left: auto;
	margin-right: 8vw;
	margin-top: -14vh;
}

/* ----------------------------------------------------------------------- void */

.mg-void {
	position: relative;
	padding: 16vh 0 24vh;
	min-height: 100svh;
	overflow-x: clip;
}

.mg-slot--void-corner {
	width: 46vw;
	margin-left: 8vw;
}

.mg-slot--void-smoke {
	width: 20vw;
	margin-left: auto;
	margin-right: 10vw;
	margin-top: -22vh;
}

/* -------------------------------------------------------------------- events */

.mg-ev-rail {
	position: relative;
	height: 280vh;
}

.mg-ev-rail__stage {
	position: sticky;
	top: 0;
	height: 100svh;
	overflow: clip;
}

body.admin-bar .mg-ev-rail__stage {
	top: 32px;
	height: calc(100svh - 32px);
}

.mg-ev-rail__track {
	display: flex;
	align-items: center;
	gap: clamp(36px, 5vw, 88px);
	height: 100%;
	width: max-content;
	padding: 0 8vw 0 34vw;
	will-change: transform;
}

.mg-slot--ev-title {
	position: absolute;
	left: 5vw;
	top: 50%;
	transform: translateY(-50%);
	z-index: 4;
	width: auto;
	max-width: 28vw;
	pointer-events: none;
}

.mg-title--ev {
	font-size: clamp(2.4rem, 5.6vw, 5.4rem);
	text-align: left;
}

.mg-slot--ev-mic { flex: 0 0 auto; width: 34vw; }
.mg-slot--ev-arms { flex: 0 0 auto; width: 50vw; }
.mg-slot--ev-hip1,
.mg-slot--ev-hip2,
.mg-slot--ev-xover,
.mg-slot--ev-crowd {
	flex: 0 0 auto;
	width: 18vw;
	align-self: flex-end;
	margin-bottom: 12vh;
}

.mg-slot--ev-hip2 { align-self: flex-start; margin-top: 16vh; margin-bottom: 0; }

/* ---------------------------------------------------------------------- wine */

.mg-wn {
	position: relative;
	padding: 20vh 0 18vh;
}

.mg-slot--wn-title {
	padding-left: 8vw;
	margin-bottom: 6vh;
}

.mg-title--wn {
	font-size: clamp(2.2rem, 6.2vw, 5.2rem);
	text-align: left;
}

.mg-slot--wn-rows {
	width: 62vw;
	margin-left: 8vw;
}

.mg-slot--wn-pour {
	width: 22vw;
	margin-left: auto;
	margin-right: 10vw;
	margin-top: -18vh;
}

.mg-slot--wn-crate {
	width: 54vw;
	margin-left: 18vw;
	margin-top: 10vh;
}

.mg-slot--wn-field {
	width: 40vw;
	margin-left: 8vw;
	margin-top: 8vh;
}

/* -------------------------------------------------------------------- legal */

.mg-legal {
	padding: clamp(7.5rem, 18vh, 11rem) var(--mg-gutter) 4vh;
}

.mg-legal__sheet {
	width: min(42rem, 100%);
}

.mg-legal__text {
	margin: 0;
	white-space: pre-wrap;
	overflow-wrap: break-word;
	font-family: var(--mg-sans);
	font-size: clamp(0.95rem, 1.35vw, 1.05rem);
	font-weight: 400;
	line-height: 1.65;
	letter-spacing: 0.01em;
	color: #f6f8ff;
}

.mg-legal__text a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 0.18em;
}

.mg-legal__text a:hover,
.mg-legal__text a:focus-visible {
	color: #fff;
	text-shadow: 0 0 0.7em rgba(4, 107, 210, 0.7);
}

/* ------------------------------------------------------------------- ending */

.mg-end {
	position: relative;
	min-height: 100svh;
	display: flex;
	align-items: flex-end;
	padding: 12vh var(--mg-gutter) clamp(48px, 10vh, 96px);
}

.mg-end.mg-end--legal {
	min-height: 0;
	padding-top: 14vh;
}

.mg-end__stage {
	width: min(1100px, 100%);
}

.mg-end__name {
	margin: 0 0 0.35em;
	font-family: var(--mg-display);
	font-weight: 400;
	font-size: clamp(3.2rem, 12vw, 11rem);
	line-height: 0.86;
	letter-spacing: -0.03em;
	color: #f6f8ff;
	text-decoration: none;
	text-shadow:
		-0.016em 0 0 rgba(255, 36, 84, 0.3),
		0.016em 0 0 rgba(4, 107, 210, 0.42),
		0 0 0.3em rgba(160, 190, 255, 0.2);
}

a.mg-end__name {
	display: block;
}

.mg-end__links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.85em 1.8em;
	margin: 0 0 2.4em;
}

.mg-end__links a {
	color: var(--mg-ink);
	font-family: var(--mg-sans);
	font-size: clamp(0.82rem, 1.15vw, 1rem);
	font-weight: 400;
	letter-spacing: 0.16em;
	text-decoration: none;
	text-shadow: 0 0 0.7em rgba(4, 107, 210, 0.35);
}

.mg-end__links a:hover,
.mg-end__links a:focus-visible {
	color: #fff;
	text-shadow: 0 0 0.8em rgba(4, 107, 210, 0.85);
}

.mg-end__line {
	margin: 0;
	font-size: clamp(0.95rem, 1.45vw, 1.4rem);
	letter-spacing: 0.045em;
	color: #eef2ff;
}

/* ------------------------------------------------------------------ tablet */

@media (max-width: 1199px) {
	.mg-slot--mark {
		width: 82%;
		left: -6%;
		top: 40%;
	}

	.mg-e1-hold {
		height: 215vh;
	}

	.mg-slot--title {
		top: 26%;
	}

	.mg-slot--tape {
		right: 7%;
		top: 64%;
		height: 50svh;
	}

	.mg-slot--chair {
		left: 4%;
		top: 66%;
		width: 22vw;
	}

	.mg-e1-spread {
		padding: 14vh 0 16vh;
	}

	.mg-slot--scaffold {
		width: 42vw;
		margin-left: 7vw;
	}

	.mg-slot--wall {
		width: 35vw;
		margin-right: 6vw;
		margin-top: -18vh;
	}

	.mg-e1-close__inner {
		min-height: 74vw;
	}

	.mg-slot--rider {
		width: 42%;
		margin-left: 4%;
	}

	.mg-slot--gallop {
		width: 56%;
		right: -10%;
		bottom: 4%;
	}

	.mg-title--enzo {
		font-size: clamp(3.2rem, 16vw, 9rem);
	}

	.mg-slot--yh-trio { width: 48vw; }
	.mg-slot--yh-lean { width: 58vw; margin-top: 6vh; }

	.mg-slot--drift-field { width: 44vw; }
	.mg-slot--drift-close { width: 30vw; margin-top: -18vh; }

	.mg-bs-hold { height: 190vh; }
	.mg-slot--bs-swan { width: 40vw; }
	.mg-slot--bs-back { width: 36vw; }
	.mg-slot--bs-gaze { width: 34vw; }
	.mg-slot--bs-face { width: 40vw; margin-top: -8vh; }

	.mg-slot--void-corner { width: 58vw; }
	.mg-slot--void-smoke { width: 28vw; margin-top: -12vh; }

	.mg-ev-rail { height: 230vh; }
	.mg-slot--ev-title { max-width: 32vw; }
	.mg-slot--ev-mic { width: 40vw; }
	.mg-slot--ev-arms { width: 54vw; }
	.mg-slot--ev-hip1,
	.mg-slot--ev-hip2,
	.mg-slot--ev-xover,
	.mg-slot--ev-crowd { width: 22vw; }

	.mg-slot--wn-rows { width: 74vw; }
	.mg-slot--wn-pour { width: 30vw; margin-top: -10vh; }
	.mg-slot--wn-crate { width: 68vw; margin-left: 10vw; }
	.mg-slot--wn-field { width: 56vw; }
}

/* ------------------------------------------------------------------ mobile */

@media (max-width: 768px) {
	.mg-crt__scan {
		opacity: 0.4;
	}

	.mg-crt__grain {
		opacity: 0.12;
	}

	/* Two continuous full-screen layers are not worth the battery here. */
	.mg-crt__roll,
	.mg-crt__flicker {
		display: none;
	}

	.mg-clock__time {
		font-size: clamp(21px, 6.6vw, 30px);
	}

	.mg-clock__date {
		font-size: 8.5px;
		letter-spacing: 0.2em;
		text-indent: 0.2em;
	}

	.mg-slot--mark {
		left: 4%;
		top: 38%;
		width: 92%;
	}

	.mg-slot--line {
		left: var(--mg-gutter);
		right: var(--mg-gutter);
		bottom: clamp(96px, 18vh, 170px);
		max-width: none;
	}

	.mg-line {
		font-size: clamp(0.88rem, 3.9vw, 1.1rem);
	}

	.mg-e1-hold {
		height: 190vh;
	}

	/*
	 * Mobile is not the desktop frame scaled down. The three objects are
	 * stacked into their own vertical rhythm: type up top, the tape holding
	 * the middle, one still breaking in from the bottom-left corner.
	 */
	.mg-slot--title {
		top: 23%;
	}

	.mg-title {
		font-size: clamp(2rem, 11.2vw, 4rem);
	}

	.mg-slot--tape {
		right: auto;
		left: 50%;
		top: 50%;
		height: 40svh;
		transform: translate(-50%, -50%);
	}

	.mg-slot--chair {
		left: 5%;
		top: auto;
		bottom: 3.5svh;
		width: 30vw;
		z-index: 4;
	}

	.mg-e1-spread {
		padding: 12vh 0 12vh;
	}

	.mg-slot--scaffold {
		width: 78vw;
		margin-left: 5vw;
	}

	.mg-slot--wall {
		width: 62vw;
		margin-right: 5vw;
		margin-top: -8vh;
	}

	.mg-e1-close {
		padding: 8vh 0 18vh;
	}

	.mg-e1-close__inner {
		width: 100%;
		min-height: 0;
		display: flow-root;
	}

	.mg-slot--rider {
		width: 74vw;
		margin-left: 5vw;
	}

	.mg-slot--gallop {
		position: relative;
		right: auto;
		bottom: auto;
		width: 86vw;
		margin-left: 14vw;
		margin-top: -6vh;
	}

	.mg-title--enzo {
		font-size: clamp(3.2rem, 28vw, 5.6rem);
	}

	.mg-yh { padding: 14vh 0 16vh; min-height: 0; }
	.mg-slot--yh-title { padding-left: 5vw; margin-bottom: clamp(3.5rem, 12vh, 7rem); }
	.mg-slot--yh-trio { width: 86vw; margin-left: 5vw; }
	.mg-slot--yh-lean { width: 92vw; margin-right: 0; margin-top: 5vh; }

	.mg-drift { padding: 8vh 0 14vh; min-height: 0; }
	.mg-slot--drift-field { width: 78vw; margin-left: 5vw; }
	.mg-slot--drift-close { width: 58vw; margin-right: 5vw; margin-top: -8vh; }
	.mg-slot--drift-tape {
		position: relative;
		left: auto;
		bottom: auto;
		height: 36svh;
		margin: 8vh 0 0 18vw;
	}

	.mg-bs-hold { height: 180vh; }
	.mg-slot--bs-title { top: 16%; }
	.mg-slot--bs-swan {
		left: 5%;
		top: auto;
		bottom: 6svh;
		width: 46vw;
		transform: none;
	}
	.mg-slot--bs-back {
		right: 5%;
		top: 42%;
		width: 42vw;
		transform: none;
	}
	.mg-bs-after { padding: 10vh 0 14vh; }
	.mg-slot--bs-gaze { width: 64vw; margin-left: 5vw; }
	.mg-slot--bs-face { width: 70vw; margin-right: 5vw; margin-top: -6vh; }

	.mg-void { padding: 10vh 0 14vh; min-height: 0; }
	.mg-slot--void-corner { width: 88vw; margin-left: 5vw; }
	.mg-slot--void-smoke { width: 52vw; margin-right: 5vw; margin-top: -8vh; }

	.mg-ev-rail { height: auto; }
	.mg-ev-rail__stage {
		position: relative;
		height: auto;
		overflow: visible;
	}
	body.admin-bar .mg-ev-rail__stage {
		top: 0;
		height: auto;
	}
	.mg-ev-rail__track {
		flex-direction: column;
		align-items: flex-start;
		width: 100%;
		height: auto;
		gap: 4vh;
		padding: 4vh 5vw 16vh;
	}
	.mg-slot--ev-title {
		position: relative;
		left: auto;
		top: auto;
		transform: none;
		max-width: none;
		width: 100%;
		padding: 10vh 5vw 2vh;
	}
	.mg-slot--ev-mic { width: 70vw; }
	.mg-slot--ev-arms { width: 88vw; align-self: flex-end; }
	.mg-slot--ev-hip1,
	.mg-slot--ev-hip2,
	.mg-slot--ev-xover,
	.mg-slot--ev-crowd {
		width: 42vw;
		align-self: flex-start;
		margin: 0;
	}
	.mg-slot--ev-hip2 { align-self: flex-end; margin-top: 0; }
	.mg-slot--ev-crowd { align-self: center; }

	.mg-wn { padding: 14vh 0 12vh; }
	.mg-slot--wn-title { padding-left: 5vw; }
	.mg-slot--wn-rows { width: 92vw; margin-left: 4vw; }
	.mg-slot--wn-pour { width: 56vw; margin-right: 5vw; margin-top: -6vh; }
	.mg-slot--wn-crate { width: 88vw; margin-left: 6vw; margin-top: 6vh; }
	.mg-slot--wn-field { width: 80vw; margin-left: 5vw; }

	.mg-end {
		align-items: flex-end;
		padding-bottom: clamp(36px, 8vh, 72px);
	}

	.mg-end__links {
		flex-direction: column;
		gap: 0.7em;
	}
}

/* --------------------------------------------------------- reduced motion  */

@media (prefers-reduced-motion: reduce) {
	.is-booting .mg-boot {
		animation: mg-boot-fade 240ms linear forwards;
	}

	.is-booting .mg-boot__beam,
	.is-booting .mg-boot__flash {
		display: none;
	}

	.is-booting .mg-boot__veil {
		opacity: 1;
		animation: none;
	}

	@keyframes mg-boot-fade {
		to { opacity: 0; visibility: hidden; }
	}

	.mg-crt__grain,
	.mg-crt__roll,
	.mg-crt__flicker,
	.mg-scrollcue i {
		animation: none;
	}

	.mg-crt__roll,
	.mg-crt__flicker {
		display: none;
	}

	.mg-logo--mark,
	.mg-caret,
	.mg-clock__colon {
		animation: none;
		opacity: 1;
	}

	.mg-reveal {
		opacity: 1;
		transform: none;
		transition: none;
	}

	.mg-move {
		will-change: auto;
	}
}
