
@font-face {
	font-family: "PermanentMarker";
	src: url("fonts/Permanent_Marker/PermanentMarker-Regular.woff2") format("woff2");
	font-weight: normal;
	font-style: normal;
	font-display: swap;
}

html,
body {
	margin: 0;
	padding: 0;
	font-size: 16px;
	font-family: sans-serif;
	color: black;
}

body {
	min-height: 450px;
	height: 100vh;
	overflow-x: hidden;
	background-color: black;
}

a {
	text-decoration: none;
}

h2, h3 {
	margin: 0;
	padding: 0;
	font-size: 30px;
	font-weight: normal;
	line-height: 1.3em;
	font-family: 'PermanentMarker', 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
	transform: rotate(-1.8deg);
}

h2.long-text {
	font-size: 24px;
	margin-top: 0.26em;
}

h3 {
	font-size: 18px;
}

#page {
	width: 100%;
	margin: 0 auto;
	position: relative;
	height: 100vh;
}

#main {
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	bottom: 0;
	animation: crtAnimation 1.2s 0.2s both;
	animation-timing-function: cubic-bezier(0.2, -0.1, 0, 1);
}

/* Header */

header {
	z-index: 1000;
	position: relative;
}

header #media-toggle {
	position: absolute;
	top: 2px;
	right: 2px;
	width: 20px;
	margin: 10px;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	opacity: 0.6;
}

header #media-toggle:hover,
header #media-toggle:focus-visible {
	opacity: 1;
}

header #media-toggle svg {
	display: block;
}

/* Track info (on the cassette label) */

#info {
	z-index: 900;
	max-width: 400px;
	margin: 8px auto 0 auto;
	position: absolute;
	width: 350px;
	top: 40px;
	left: 0;
	right: 0;
}

#links {
	float: right;
	display: none;
}

#progress {
	width: 100%;
	background-color: #00823b;
	display: none;
}

#bar {
	width: 0%;
	background-color: #008dd2;
	height: 5px;
	margin: 5px 0;
}

#time {
	float: right;
	margin-top: 5px;
	font-size: 12px;
}

/* Track List (hidden for now) */

#frame {
	display: none;
	background-color: darkslategray;
	color: white;
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	margin: 0 auto;
	z-index: 200;
	overflow: hidden;
	width: 550px;
	max-width: 90vw;
}

#list {
	background-color: black;
	color: white;
	height: calc( 100% - 98px );
	overflow: scroll;
}

#list ol {
	padding: 0;
	margin: 10px 0;
	color: darkgray;
}

#list li {
	padding: 10px 20px;
	cursor: pointer;
}

#list h2,
#list h3 {
	font-size: 14px;
	color: white;
}

#list h3 {
	color: darkgray;
}

#list li span {
	float: right;
	font-size: 14px;
}

#list li:hover {
	background-color: darkgrey;
	color: lightgrey;
}

#list li:hover h3 {
	color: lightgrey;
}

#list li.active h2 {
	color: hotpink;
}

/* Background layers */

#background,
#background video {
	position: absolute;
	width: 100vw;
	height: 100vh;
	top: 0px;
	left: 0px;
	z-index: 0;
}

/* Hidden until the music first plays, then fades in */
#background {
	opacity: 0;
	transition: opacity 2s ease-in;
}

#background.started {
	opacity: 1;
}

#background video {
	object-fit: cover;
	pointer-events: none;
	visibility: hidden;
}

#background video.visible {
	visibility: visible;
}

/* iOS Low Power Mode blocks autoplay and shows a play button; hide it */
#background video::-webkit-media-controls-start-playback-button {
	display: none;
}

#crt {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: url(images/lines.jpg);
	background-size: 7px auto;
	mix-blend-mode: overlay;
	pointer-events: none;
	opacity: 0.4;
	z-index: 100;
}

#vignette {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: url(images/vignette.png);
	background-size: 100% 100%;
	mix-blend-mode: overlay;
	pointer-events: none;
	opacity: 0.6;
	z-index: 110;
}

@keyframes crtAnimation {
	0% {
		transform: scaleY(0) scaleX(0);
		filter: brightness(15) blur(0px);
	}
	20% {
		transform: scaleY(0.02) scaleX(0.8);
		filter: brightness(15) blur(0px);
	}
}

/* Video */

#video-frame {
	position: absolute;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	transition: opacity 920ms;
	opacity: 0;
	overflow: hidden;
}

#video-frame.i-want-my-mtv {
	opacity: 0.5;
}

#video-frame iframe {
	position: absolute;
	top: 50%;
	left: 50%;
	right: 0;
	transform: translate(-50%, -50%);
	width: 233.33vh;
	height: 120vh;
	min-width: 100vw;
	max-width: none;
	padding: 0;
	margin: 0;
	border: 0;
	animation: lineInserted 300ms;
	transition: height 300ms;
	pointer-events: none;
}

@keyframes lineInserted {
	from { height: 0; }
	to   { height: 80px; }
}

/*
	Cassette (mostly)
*/

#vc-container {
	margin: 0 auto;
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	transform: translateY(-50%);
}

.vc-container {
	text-align: center;
	position: relative;
}

.vc-tape-wrapper {
	zoom: 70%;
	perspective: 800px;
}

@media all and (max-width: 30em) {
	.vc-tape-wrapper {
		zoom: 60%;
	}
}

.vc-tape {
	width: 586px;
	height: 379px;
	margin: 30px auto 0;
	position: relative;
	transition: all .4s ease-in-out;
}

.vc-tape-back {
	width: 100%;
	height: 100%;
	position: relative;
	background: transparent url(images/cassette/cs_back.png) no-repeat center center;
}

.vc-tape-front {
	width: 100%;
	height: 100%;
	position: absolute;
	background: transparent url(images/cassette/front-v3.webp) no-repeat center center;
	background-size: contain;
	top: 0px;
	left: 0px;
}

.vc-tape-front span {
	color: rgba(0, 0, 0, 0.6);
	position: absolute;
	top: 83px;
	left: 67px;
	font-family: Arial;
	font-weight: bold;
	font-size: 20px;
}

/* Wheels: the black box-shadow is the wound tape. --progress (0–1) is set from JS */

.vc-tape-wheel {
	width: 125px;
	height: 125px;
	position: absolute;
	top: 110px;
	background: transparent;
	border-radius: 50%;
	transition: box-shadow ease 12s;
}

.vc-tape-wheel-left {
	left: 106px;
	box-shadow: 0 0 0 calc(var(--progress, 0) * 70px) #000;
}

.vc-tape-wheel-right {
	right: 111px;
	box-shadow: 0 0 0 calc((1 - var(--progress, 0)) * 70px) #000;
}

.vc-tape-wheel div {
	width: 100%;
	height: 100%;
	background: transparent url(images/cassette/cs_wheel.png) no-repeat center center;
}

@keyframes rotateLeft {
	0% { transform: rotate(0deg) translateZ(-1px); }
	100% { transform: rotate(-360deg) translateZ(-1px); }
}

@keyframes rotateRight {
	0% { transform: rotate(0deg) translateZ(-1px); }
	100% { transform: rotate(360deg) translateZ(-1px); }
}

.animation-play div.vc-tape-wheel {
	animation: 2s linear 0s infinite normal forwards running rotateRight;
}

.animation-fwd div.vc-tape-wheel {
	animation: 1s linear 0s infinite normal forwards running rotateRight;
}

.animation-rew div.vc-tape-wheel {
	animation: 1s linear 0s infinite normal forwards running rotateLeft;
}

.animation-stop div.vc-tape-wheel {
	animation: 2s ease-out 0s 1 normal forwards running rotateRight;
}

/* Controls */

.vc-controls {
	width: 320px;
	height: 54px;
	margin: 0 auto;
	padding: 8px;
	box-sizing: content-box;
	border: 1px solid rgba(0,0,0,0.1);
	border-bottom-color: rgba(255,255,255,0.6);
	border-radius: 12px;
	box-shadow:
		inset 0 1px 0px rgba(0,0,0,0.05),
		0 1px 0 rgba(255,255,255,0.8),
		0 -1px 0 rgba(255,255,255,0.4),
		inset 0 2px 19px rgba(0,0,0,0.05),
		0 2px 1px rgba(0,0,0,0.06);
}

#ctrls button {
	appearance: none;
	display: block;
	float: left;
	box-sizing: border-box;
	width: 70px;
	height: 54px;
	/* Label sits low on the key, like the original line-height trick */
	padding: 29px 10px 9px;
	margin: 0;
	border: 0;
	border-radius: 0;
	line-height: 16px;
	text-align: left;
	cursor: pointer;
	background: #ddd url(images/cassette/metal.jpg) no-repeat center top;
	box-shadow:
		inset 0 0 0 1px rgba(0,0,0, 0.2),
		inset 0 0 1px 2px rgba(255,255,255,0.9),
		inset 0 -6px 5px rgba(0,0,0,0.1),
		0 6px 7px rgba(0,0,0,0.3),
		0 4px 1px rgba(0,0,0,0.5);
	font-family: Arial, Helvetica, sans-serif;
	font-size: 10px;
	font-weight: 300;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: #666;
	text-shadow: 0 1px 1px rgba(255,255,255,0.8);
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	user-select: none;
}

#ctrls button:first-child {
	border-radius: 8px 0 0 8px;
}

#ctrls button:last-child {
	border-radius: 0px 8px 8px 0px;
}

#ctrls button.vc-control-play {
	width: 110px;
}

#ctrls button:hover {
	box-shadow:
		inset 0 0 0 1px rgba(0,0,0, 0.2),
		inset 0 0 1px 2px rgba(255,255,255,0.9),
		inset 0 -10px 15px rgba(0,0,0,0.1),
		0 6px 7px rgba(0,0,0,0.3),
		0 4px 1px rgba(0,0,0,0.5);
}

/* Pressed (active) */
#ctrls button.vc-control-active {
	margin-top: 2px;
	background-image: url(images/cassette/metal_dark.jpg);
	box-shadow:
		inset 0 0 0 1px rgba(0,0,0, 0.18),
		inset 0 0 1px 2px rgba(255,255,255,0.5),
		inset 0 -6px 5px rgba(0,0,0,0.1),
		0 6px 7px rgba(0,0,0,0.3),
		0 2px 1px rgba(0,0,0,0.5);
}
