* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
	touch-action: manipulation;
}

button {
	border: none;
}

body {
	background-color: var(--accent);
	font-family: "JetBrains Mono", serif;
	font-size: clamp(1rem, 2vw, 2rem);
	font-weight: 300;
	font-style: normal;
	color: var(--black);

	--black: #00000d;
	--white: #e8e0da;
	--accent: #e7717b;
	--danger: #ff425d;

	padding: 100px;
}

@keyframes curtain-open {
	from {
		transform: translateY(100%);
	}

	to {
		transform: translateY(0);
	}
}

@keyframes curtain-close {
	from {
		transform: translateY(0);
	}

	to {
		transform: translateY(-100%);
		display: none;
	}
}

.curtain {
	position: fixed;
	/* background: var(--color, var(--white)); */
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 200;
	display: none;

	&.active {
		animation: curtain-open 0.5s forwards;
		display: block;
	}

	/* animation: curtain-close 1s forwards; */
}

.text-container {
	overflow: hidden;
	width: fit-content;
	height: fit-content;
	vertical-align: bottom;
	--delay: 0s;
	--x: 0;
	--y: 1;
	animation: reveal-overflow 0.8s var(--delay) forwards;
	animation-play-state: paused;

	&>* {
		transform: translate(calc(var(--x) * 100%), calc(var(--y) * 100%));
		animation: reveal 0.8s cubic-bezier(0.77, 0, 0.175, 1) var(--delay) forwards;
		animation-play-state: paused;
	}

	&.in-view {
		animation-play-state: running;

		&>* {
			animation-play-state: running;
		}
	}
}

@keyframes reveal {
	to {
		transform: translate(0, 0);
	}
}

@keyframes reveal-overflow {

	0%,
	99% {
		overflow: hidden;
	}

	100% {
		overflow: visible;
	}
}

.separator {
	width: 100%;
	height: 2px;
	background: var(--black);
}

a:visited,
a {
	color: var(--white);
}

a:not(.button-area) {
	font-weight: 500;
	text-decoration-thickness: 2px;
	transition: background 0.15s, color 0.2s;

	&:hover {
		background: var(--white);
		color: var(--black);
	}
}

a.button-area {
	text-decoration: none;
}

footer {
	margin-top: 50px;
}

svg {
	width: 1em;
	height: 1em;
	display: inline-block;
	/* vertical-align: middle; */
	margin-top: 0.04em;
	stroke-width: 2px;
}

.cursor {
	position: fixed;
	top: 0;
	left: 0;
	pointer-events: none;
	z-index: 102;
	will-change: transform;
	background: none;

	transition: opacity 0.1s;

	&.none {
		opacity: 0;
	}

	background-color: transparent;

	&:has(.diff) {
		mix-blend-mode: exclusion;
	}
}

.cursor>.ball {
	position: absolute;
	width: clamp(0.3rem, 1vw, 0.6rem);
	height: clamp(0.3rem, 1vw, 0.6rem);
	border-radius: 999px;
	background-color: var(--black);
	translate: -50% -50%;
	/* will-change: transform; */
	transition: background-color 0.2s;

	&.focus,
	&.diff {
		background-color: var(--white);
		/* mix-blend-mode: difference; */
	}
}

.cursor>.text {
	position: absolute;
	translate: -50% -50%;
	display: flex;
	color: var(--white);
	font-size: clamp(0.1rem, 1vw, 0.14rem);
	font-family: "JetBrains Mono";
	font-weight: 500;
	text-align: center;
	align-items: center;
	justify-content: center;
	mix-blend-mode: difference;
	white-space: nowrap;
	/* will-change: transform; */
}

@keyframes pop-load {
	from {
		opacity: 0;
		scale: 0.9;
	}

	to {
		opacity: 1;
		scale: 1;
	}
}

@keyframes bob {
	0% {
		scale: 1;
	}

	35% {
		scale: 1.1 1;
	}

	100% {
		scale: 1;
	}
}

.nav-container {
	width: 100%;
	justify-content: center;
	display: flex;
	flex-wrap: wrap;
}

.button-area {
	display: flex;
	background: none;
	width: clamp(15rem, 30vw, 18rem);
	height: 6rem;
	justify-content: center;
	align-items: center;
	cursor: pointer;
}

.button-area span {
	background-image: linear-gradient(to right, var(--black) 50%, var(--white) 50%);
	background-size: 300%;
	background-position-x: 100%;
	border: 2px solid black;
	display: flex;
	text-align: center;
	align-items: center;
	justify-content: center;
	height: 3rem;
	width: clamp(10rem, 20vw, 12rem);
	font-family: "JetBrains Mono",
		serif;
	font-size: clamp(1rem, 2vw, 1.2rem);
	font-weight: 300;
	font-style: normal;
	color: var(--black);
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	user-select: none;
	-webkit-user-select: none;
}

body.test {
	.button-area {
		opacity: 0;
		scale: 0;
		animation: pop-load 1s forwards var(--delay, 0s);
	}
}

.button-area {
	& span {
		margin-top: 4px;
		will-change: scale;
		transition:
			background-position 1s cubic-bezier(.08, .72, 0, .91), color 0.15s, translate 0.15s cubic-bezier(.04, .61, 1, 1);
	}

	&:active span {
		background-position-x: 0%;
		color: var(--white);
		animation: bob 0.4s cubic-bezier(.04, .61, 1, 1);
	}

	@media (hover: hover) {
		&:hover span {
			background-position-x: 0%;
			color: var(--white);
			animation: bob 0.4s cubic-bezier(.04, .61, 1, 1);
		}
	}

	&.toggle span {
		translate: 50px;
	}
}


@media (max-width: 500px) {
	body {
		padding: 50px;
	}

	.cursor>.ball {
		width: clamp(0.9rem, 1vw, 1.1rem);
		height: clamp(0.9rem, 1vw, 1.1rem);
	}

	.cursor>.text {
		font-size: clamp(0.1rem, 1vw, 0.2rem);
	}
}
