@font-face {
	font-family: Chubby;
	src: url(/font/chubby-and-groovy.ttf);
	font-display: swap;
}

@font-face {
	font-family: Figtree;
	src: url(/font/figtree.ttf);
	font-weight: 300 900;
	font-display: swap;
}

:root {
	--white0: #fff;
	--white1: #c9c9c9;
	--white2: #8e8e8e;
	--white3: #525252;
	--white4: #2c2c2c;
	--white5: #282828;
	--white6: #202020;
	--white7: #121212;
	--white8: #0b0b0b;
	--black: #000;
	--red: #ff0056;
	--green: #79b048;
	--yellow: #d2dd72;
	--orange: #f08a24;
	--deep: #033511;
	--glow: #69a237;
	--tint: color-mix(in srgb, var(--glow) 45%, #fff);
	--time: 62.5ms;
	--z-suggestions: 1;
	--z-loading: 2;
	--z-toast: 3;
	color-scheme: dark;
}

.orange {
	--deep: #3a1500;
	--glow: #d9761e;
}

.grapefruit {
	--deep: #3a0614;
	--glow: #d84a62;
}

.blueberry {
	--deep: #0b1140;
	--glow: #5560d6;
}

.grape {
	--deep: #26093a;
	--glow: #9a4ecf;
}

.lemon {
	--deep: #2c2700;
	--glow: #c4b02a;
}

* {
	box-sizing: border-box;
	margin: 0;
}

html, body {
	font: 16px/1.45 Figtree, system-ui, sans-serif;
	color: var(--white0);
	min-height: 100dvh;
	overflow-x: hidden;
}

html {
	background: var(--deep);
}

#fluid {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: -1;
}

body::after {
	content: '';
	position: fixed;
	inset: 0;
	z-index: -1;
	background: url(/grain.png) 0 0 / 130px;
	mix-blend-mode: overlay;
	pointer-events: none;
}

a {
	color: inherit;
	text-decoration: none;
	&:hover {
		text-decoration: underline;
	}
}

input, button, select {
	font: inherit;
}

:focus {
	outline: none;
}

h1, .logo {
	font-family: Chubby, Figtree, sans-serif;
	font-weight: normal;
	line-height: 1;
}

h2, .archetype, .section, .who, .name, .ring, .count b {
	font-weight: 800;
	line-height: 1.1;
}

h1 {
	font-size: clamp(3.5rem, 15vw, 7rem);
	line-height: .82;
	& span {
		display: block;
		color: var(--yellow);
	}
}

h2 {
	font-size: 2rem;
	margin: 1.5rem 0 .75rem;
}

#app {
	max-width: 36rem;
	margin: auto;
	padding: 1.25rem 1.25rem 3rem;
}

.hidden {
	display: none;
}

.twin:first-child, .invite, .pair {
	background-blend-mode: overlay, normal;
	background-color: color-mix(in srgb, var(--deep) 55%, #000);
	background-image: url(/grain.png), radial-gradient(160% 150% at 0 -20%, color-mix(in srgb, var(--glow) 55%, transparent), #0000 80%);
	background-repeat: repeat, no-repeat;
	background-size: 130px, cover;
	box-shadow: inset -.5px .5px 2px color-mix(in srgb, var(--glow) 25%, transparent);
}

header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 1.5rem;
}

.logo {
	display: flex;
	align-items: center;
	gap: .25rem;
	font-size: 1.75rem;
	color: var(--yellow);
	&:hover {
		text-decoration: none;
	}
	& img {
		width: 2.25rem;
		aspect-ratio: 1;
		margin: 0 .25rem;
	}
	& span {
		color: var(--green);
	}
}

.hero {
	margin: 1rem 0 1.5rem;
	& p {
		font-size: 1.25rem;
		margin-top: 1rem;
		color: var(--white1);
	}
}

.reveal {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 1.25rem;
	min-height: 62dvh;
	text-align: center;
	color: var(--tint);
	animation: rise .8s cubic-bezier(.2, 1.4, .4, 1) both;
	& h1 {
		font-size: clamp(2.5rem, 11vw, 4.25rem);
		text-wrap: balance;
	}
	& p {
		max-width: 24rem;
		font-size: 1.2rem;
		text-wrap: balance;
	}
	& .faces {
		display: flex;
		& img {
			width: 4.5rem;
			aspect-ratio: 1;
			margin: 0 -.6rem;
			border-radius: 50%;
			object-fit: cover;
			box-shadow: 0 0 0 1px #0008;
		}
	}
	& .button {
		display: flex;
		justify-content: center;
		align-items: center;
		width: 3.5rem;
		aspect-ratio: 1;
		padding: 0;
		border-radius: 50%;
		font-size: 1.5rem;
	}
}

.link {
	margin-top: .25rem;
	font-size: .9rem;
	color: var(--white1);
}

.honesty {
	display: block;
	color: var(--tint);
	font-size: .85rem;
	font-weight: 700;
}

.marquee {
	display: flex;
	overflow: hidden;
	margin: 0 -1.25rem 1.5rem;
	mask: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
	& div {
		display: flex;
		gap: .75rem;
		animation: scroll 30s linear infinite;
	}
	& figure {
		flex: none;
		width: 5rem;
		margin: 0;
		overflow: hidden;
		text-align: center;
		text-overflow: ellipsis;
		white-space: nowrap;
		font-size: .85rem;
		color: var(--white1);
	}
	& img {
		display: block;
		width: 5rem;
		aspect-ratio: 1;
		margin-bottom: .25rem;
		border-radius: 50%;
		object-fit: cover;
	}
}

@keyframes scroll {
	to {
		transform: translateX(-50%);
	}
}

form {
	display: flex;
	flex-direction: column;
	gap: .75rem;
	& label {
		font-weight: 700;
		font-size: .9rem;
		color: var(--white1);
	}
}

input, select {
	width: 100%;
	padding: .9rem 1.1rem;
	border: 1px solid #fff2;
	border-radius: .9rem;
	background: #fff1;
	color: var(--white0);
	font-size: 1.1rem;
	backdrop-filter: blur(1rem);
	&::placeholder {
		color: #fff8;
	}
	&:hover, &:focus {
		border-color: #fff5;
		background-color: #fff2;
	}
	&.taken {
		box-shadow: 0 0 0 1px var(--red);
	}
}

select {
	padding-right: 2.75rem;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6.5l4 4 4-4' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 1rem center;
	background-size: 1rem;
	cursor: pointer;
}

input[type=number] {
	appearance: textfield;
	&::-webkit-inner-spin-button, &::-webkit-outer-spin-button {
		appearance: none;
	}
}

.handle {
	position: relative;
	&::before {
		content: '@';
		position: absolute;
		top: 50%;
		left: 1.1rem;
		translate: 0 -50%;
		z-index: 1;
		color: #fffb;
		font-size: 1.1rem;
		pointer-events: none;
	}
	& input {
		padding-left: 2.4rem;
	}
}

.note.unavailable {
	color: var(--red);
}

.facts {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
	margin: -.25rem 0 1.25rem;
	& span {
		display: flex;
		align-items: center;
		gap: .4rem;
		padding: .3rem .8rem;
		border-radius: 2rem;
		background: #fff1;
		font-weight: 600;
	}
}

.icon {
	display: inline-block;
	flex: none;
	width: 1em;
	height: 1em;
	vertical-align: -.125em;
	background: currentColor;
	mask: var(--icon) center / contain no-repeat;
}

h2 small {
	margin-left: .25rem;
	color: var(--white2);
	font-size: .9rem;
	font-weight: 500;
}

.about .fields {
	display: grid;
	grid-template-columns: 6rem 1fr;
	gap: .5rem;
}

.autocomplete {
	position: relative;
}

.suggestions {
	position: absolute;
	animation: drop .15s ease-out;
	z-index: var(--z-suggestions);
	margin: 0;
	padding: .25rem;
	overflow-y: auto;
	overscroll-behavior: contain;
	border-radius: .9rem;
	background: #000d;
	box-shadow: inset 0 0 0 1px #fff2, 0 1rem 2rem #0008;
	backdrop-filter: blur(1rem);
	list-style: none;
	&:empty {
		display: none;
	}
	& li {
		padding: .7rem .9rem;
		border-radius: .65rem;
		font-weight: 500;
		cursor: pointer;
		&:hover, &[aria-selected=true] {
			background: #fff2;
		}
	}
}

.options {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
	& label {
		position: relative;
	}
	& input {
		position: absolute;
		width: 0;
		opacity: 0;
		pointer-events: none;
	}
	& span {
		display: block;
		padding: .5rem 1rem;
		border-radius: 2rem;
		background: #fff1;
		box-shadow: inset 0 0 0 1px #fff2;
		font-weight: 600;
		cursor: pointer;
		&:hover {
			background: #fff2;
		}
	}
	& input:checked + span {
		background: var(--yellow);
		box-shadow: none;
		color: var(--black);
	}
}

button, .button {
	padding: .95rem 1.5rem;
	border: 0;
	border-radius: 2rem;
	background: var(--yellow);
	color: var(--black);
	font-weight: 800;
	font-size: 1.1rem;
	text-align: center;
	cursor: pointer;
	&:hover {
		box-shadow: 0 0 .5rem var(--yellow);
		text-decoration: none;
	}
	&:active {
		transform: scale(.96);
	}
	&:disabled {
		opacity: .5;
		pointer-events: none;
	}
	&.secondary {
		background: transparent;
		box-shadow: inset 0 0 0 1px #fff5;
		color: var(--white0);
		&:hover {
			background: #fff1;
			box-shadow: inset 0 0 0 1px #fffa;
		}
	}
	&.small {
		padding: .55rem 1rem;
		font-size: .9rem;
	}
}

.error {
	padding: .75rem 1rem;
	border-radius: .5rem;
	background: color-mix(in srgb, var(--red) 15%, transparent);
	box-shadow: 0 0 0 1px var(--red);
	font-weight: 600;
	&:empty {
		display: none;
	}
}

.notifications {
	display: flex;
	align-items: center;
	gap: .4rem;
	margin-bottom: 1rem;
}

footer {
	margin-top: 4rem;
	color: var(--white2);
	font-size: .85rem;
	& a {
		color: var(--white1);
		text-decoration: underline;
	}
}

pre {
	margin: 0 0 1rem;
	padding: 1rem;
	overflow-x: auto;
	border-radius: .9rem;
	background: #0008;
	font-size: .85rem;
	tab-size: 2;
}

.note {
	font-size: .9rem;
	color: var(--white2);
}

.invite {
	margin-bottom: 1.25rem;
	padding: 1rem 1.25rem;
	border-radius: 1.25rem;
	font-weight: 700;
}

.count {
	display: flex;
	flex-direction: column;
	gap: .75rem;
	margin: 3rem 0;
	& b {
		margin-right: .25rem;
		font-size: 3.5rem;
		color: var(--yellow);
	}
	& form {
		flex-direction: row;
		gap: .5rem;
	}
	& input {
		padding: .6rem 1rem;
		font-size: 1rem;
	}
	& button {
		white-space: nowrap;
	}
	& .note {
		color: var(--white1);
	}
}

.loading {
	position: fixed;
	inset: 0;
	z-index: var(--z-loading);
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 1.5rem;
	background: #121212ee;
	font-size: 1.25rem;
	font-weight: 700;
	& img {
		width: 7rem;
		animation: spin 1.5s linear infinite;
	}
}

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

.card {
	position: relative;
	margin: 3rem 0 4rem;
	animation: rise .5s cubic-bezier(.2, 1.4, .4, 1) both;
	& .kicker {
		margin-bottom: .5rem;
		font-weight: 700;
		font-size: .9rem;
		color: var(--white1);
	}
	& .archetype {
		margin: .5rem 0;
		font-size: clamp(2.75rem, 12vw, 4.5rem);
		color: var(--yellow);
	}
	& .tagline {
		margin-bottom: 1.25rem;
		font-size: 1.1rem;
	}
}

@keyframes drop {
	from {
		opacity: 0;
		translate: 0 -.25rem;
	}
}

@keyframes rise {
	from {
		opacity: 0;
		transform: translateY(2.5rem) scale(.95);
	}
}

.who {
	display: flex;
	align-items: center;
	gap: .75rem;
	margin-bottom: 1rem;
	font-size: 1.5rem;
}

.unread {
	margin-left: .4rem;
	padding: 0 .45rem;
	border-radius: 2rem;
	background: var(--red);
	color: var(--white0);
	font-size: .8rem;
}

.avatar {
	flex: none;
	width: 3.25rem;
	aspect-ratio: 1;
	border-radius: 50%;
	object-fit: cover;
	background: var(--white4);
}

.top {
	display: flex;
	flex-direction: column;
	gap: .5rem;
	padding: 0;
	list-style: none;
	& li {
		display: flex;
		align-items: center;
		gap: .75rem;
		font-weight: 700;
		font-size: 1.25rem;
		animation: rise .5s both;
		&:nth-child(2) {
			animation-delay: 80ms;
		}
		&:nth-child(3) {
			animation-delay: 160ms;
		}
		&:nth-child(4) {
			animation-delay: 240ms;
		}
		&:nth-child(5) {
			animation-delay: 320ms;
		}
	}
	& b {
		width: 1.5rem;
		font-weight: 800;
		color: var(--tint);
	}
	& img {
		width: 3.5rem;
		aspect-ratio: 1;
		border-radius: .5rem;
		object-fit: cover;
		background: #0004;
	}
	&.round img {
		border-radius: 50%;
	}
	& small {
		display: block;
		font-weight: 400;
		font-size: .9rem;
		color: var(--white1);
	}
}

.stats {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: .5rem;
	margin: 1.25rem 0;
	& div {
		font-size: .85rem;
		color: var(--white1);
	}
	& b {
		display: block;
		font: 800 1.75rem Figtree, sans-serif;
	}
}

.chips {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
	& span {
		padding: .25rem .75rem;
		border-radius: 2rem;
		background: color-mix(in srgb, var(--glow) 35%, #0006);
		font-weight: 600;
		font-size: .9rem;
	}
}

.twins {
	display: flex;
	flex-direction: column;
	gap: .75rem;
	margin-bottom: 1.25rem;
}

.twin {
	display: flex;
	align-items: center;
	gap: .75rem;
	padding: 1rem;
	border-radius: 1.25rem;
	animation: rise .5s both;
	&:hover {
		text-decoration: none;
	}
	&:nth-child(2) {
		animation-delay: 150ms;
	}
	&:nth-child(3) {
		animation-delay: 300ms;
	}
	& > div:first-child {
		flex: 1;
		min-width: 0;
		color: var(--white1);
	}
	& .name {
		display: block;
		font-size: 1.5rem;
		color: var(--white0);
	}
	& .side {
		align-self: flex-start;
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: .75rem;
	}
	& .faces {
		display: flex;
		margin-top: .5rem;
		& img {
			margin-right: -.4rem;
			width: 2rem;
			aspect-ratio: 1;
			border-radius: 50%;
			object-fit: cover;
			box-shadow: 0 0 0 1px #0008;
		}
	}
}

.ring {
	--percent: 0;
	position: relative;
	display: grid;
	place-items: center;
	flex: none;
	width: 5.25rem;
	aspect-ratio: 1;
	font-size: 1.3rem;
	& svg {
		position: absolute;
		inset: 0;
		width: 100%;
		height: 100%;
		overflow: visible;
		rotate: -90deg;
	}
	& span {
		line-height: 1;
	}
	& circle {
		fill: none;
		stroke-width: 7;
		stroke-linecap: round;
	}
	& .track {
		stroke: #fff2;
	}
	& .arc {
		stroke: var(--yellow);
		stroke-dasharray: var(--percent) 100;
		filter: drop-shadow(0 0 3px var(--yellow)) drop-shadow(0 0 8px color-mix(in srgb, var(--yellow) 60%, transparent));
	}
	&.huge {
		width: 13rem;
		margin: .75rem auto 1.25rem;
		font-size: 4rem;
	}
}

.pair {
	padding: 1.5rem 1.25rem;
	border-radius: 1.25rem;
	text-align: center;
	& .top {
		text-align: left;
	}
}

.share {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: .5rem;
	margin-bottom: 1.5rem;
	& button:first-child {
		grid-column: span 2;
	}
}

.section {
	margin: 2rem 0 .75rem;
	font-size: 1.75rem;
}

.inbox a {
	display: flex;
	align-items: center;
	gap: .75rem;
	padding: .75rem 0;
	&:hover {
		text-decoration: none;
		background: var(--white8);
	}
	& div {
		flex: 1;
		min-width: 0;
	}
	& p {
		color: var(--white2);
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}
	&.new {
		& b::after {
			content: '';
			display: inline-block;
			width: .55rem;
			aspect-ratio: 1;
			margin-left: .4rem;
			vertical-align: .1rem;
			border-radius: 50%;
			background: var(--green);
			box-shadow: 0 0 .5rem var(--green);
		}
		& p {
			color: var(--white0);
			font-weight: 700;
		}
	}
	& .badge {
		padding: .15rem .6rem;
		border-radius: 2rem;
		background: var(--yellow);
		color: var(--black);
		font-weight: 800;
	}
}

.chat {
	display: flex;
	flex-direction: column;
	height: calc(100dvh - 3rem);
	& .messages {
		flex: 1;
		display: flex;
		flex-direction: column;
		gap: .3rem;
		margin: 0 -.5rem;
		padding: 1rem .5rem;
		overflow-y: auto;
		& > :first-child {
			margin-top: auto;
		}
	}
	& .message {
		position: relative;
		& time {
			float: right;
			margin: .45rem 0 -.2rem .6rem;
			color: #fff8;
			font-size: .7rem;
			line-height: 1;
			white-space: nowrap;
		}
		&.mine time {
			color: #0008;
		}
		max-width: 80%;
		padding: .55rem .95rem;
		border-radius: 1.25rem;
		background: color-mix(in srgb, var(--deep) 30%, #070707);
		white-space: pre-wrap;
		overflow-wrap: anywhere;
		&:not(:has(+ .message:not(.mine))):not(.mine) {
			border-bottom-left-radius: 0;
			&::before {
				content: '';
				position: absolute;
				bottom: 0;
				left: calc(-.5rem + 1px);
				width: .5rem;
				height: .78rem;
				background: inherit;
				mask: url(/icon/message-corner.svg) center / contain no-repeat;
			}
		}
		&.mine {
			align-self: flex-end;
			background: var(--yellow);
			color: var(--black);
			&:not(:has(+ .mine)) {
				border-bottom-right-radius: 0;
				&::before {
					content: '';
					position: absolute;
					bottom: 0;
					right: calc(-.5rem + 1px);
					width: .5rem;
					height: .78rem;
					background: inherit;
					mask: url(/icon/message-corner.svg) center / contain no-repeat;
					scale: -1 1;
				}
			}
		}
		&.mine + :not(.mine), &:not(.mine) + .mine {
			margin-top: .6rem;
		}
	}
	& .icebreaker {
		margin: auto 0;
		text-align: center;
		color: var(--white1);
	}
}

.chat-head {
	display: flex;
	align-items: center;
	gap: .6rem;
	padding-bottom: .5rem;
	& .avatar {
		width: 2.5rem;
	}
	& .title {
		flex: 1;
		min-width: 0;
	}
	& .name {
		display: block;
		font-size: 1.15rem;
	}
	& .ring.small {
		width: 3rem;
		font-size: .8rem;
	}
}

.composer {
	flex-direction: row;
	align-items: center;
	gap: .25rem;
	padding: .3rem;
	border-radius: 2rem;
	background: #0009;
	backdrop-filter: blur(1rem);
	& input {
		border: 0;
		background: transparent;
		backdrop-filter: none;
		&:hover, &:focus {
			background: transparent;
		}
	}
	& button {
		display: grid;
		place-items: center;
		flex: none;
		width: 2.75rem;
		aspect-ratio: 1;
		padding: 0;
		font-size: 1.1rem;
	}
}

#toast {
	position: fixed;
	left: 50%;
	bottom: 1.5rem;
	z-index: var(--z-toast);
	max-width: min(90vw, 24rem);
	padding: .6rem 1rem;
	border-radius: .75rem;
	background: var(--white0);
	color: var(--black);
	font-weight: 700;
	text-align: center;
	transform: translateX(-50%);
}
