@font-face {
	font-family: LTRenovate;
	src: url(resource/LTR.woff2);
}
body {
	font-family: LTRenovate, sans-serif;
}

h1 {
	color: #777
}
.content {
	display: flex;
	align-items: center;
	flex-direction: column;
}

.frosty {
	box-shadow: inset 0 -10px 30px rgba(0, 0, 0, 0.12);
	overflow: hidden;
	position: relative;
	z-index: 0;
	color: #777;
}
.frosty::before {
	mask-image: linear-gradient(to top, black 0%, transparent 45px);
	inset: 0;
	content: "";
	position: absolute;
	background-image: url("resource/grain.png");
	background-size: 50px 50px;
	opacity: 0.5;
	z-index: -1;
}
.talkbox.frosty input::placeholder { color: rgb(119 119 119 / 0.4); }

.chatbox {
	display: flex;
	flex-direction: column;
	border-radius: 30px;
	padding: 10px;
	min-width: 400px;
	background-color: #eee;
	position: relative;
}

.message {
	flex-shrink: 0;
	margin-top: 5px;
	margin-bottom: 5px;
	border-radius: 30px;
	padding: 15px;
	min-width: 400px;
	max-width: 400px;
	overflow-wrap: break-word;
	animation: edge-shrink linear both;
	animation-timeline: view();
}
.messages {
	padding: 10px;
	display: flex;
	flex-direction: column-reverse;
	height: 400px;
	overflow-y: auto;
	margin-bottom: -5px;
	scrollbar-width: none;
	-ms-overflow-style: none;
}
.talkbox {
	align-items: center;
	display: flex; 
	border-radius: 30px;
	padding-left: 20px;
	padding-top: 10px;
	padding-bottom: 10px;
	padding-right: 10px;
	max-width: 800px;
	background: linear-gradient(0deg, var(--usercolor), oklch(from var(--usercolor) calc(l + 0.08) calc(c * 1.1) h));
	z-index: 99;
}
.talkbox input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font: inherit;
    color: oklch(from var(--usercolor) calc(0.40 + 0.67 * clamp(0, (0.7 - l) * 1000, 1)) calc(c * 0.35) h);
}
.talkbox input::placeholder {
    color: oklch(from var(--usercolor) calc(0.40 + 0.67 * clamp(0, (0.7 - l) * 1000, 1)) calc(c * 0.35) h / 0.4);
    opacity: 1; /* firefox... */
}

.talkbox .button {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    opacity: 60%;
    transition: opacity 0.3s cubic-bezier(0.5, 1, 0.89, 1);
    animation: spin 100s linear infinite;
}

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



.talkbox .button img {
    width: 30px;
    display: block;
}
.talkbox .button:hover {
	opacity: 100%;
}

.superfill {
  background: linear-gradient(0deg, var(--color), oklch(from var(--color) calc(l + 0.08) calc(c * 1.1) h));
  color: oklch(from var(--color) calc(0.40 + 0.67 * clamp(0, (0.7 - l) * 1000, 1)) calc(c * 0.35) h);
}


.fadeout {
	position: absolute;
	top: 10px;
	left: 10px;
	right: 10px;
	height: 10px;
	background: linear-gradient(#eee, transparent);
	pointer-events: none;
	z-index: 100;
}

@keyframes edge-fade {
	entry 0%   { scale: 0.92; animation-timing-function: cubic-bezier(0.5, 1, 0.89, 1); }
	entry 100% { scale: 1;    }
	exit 0%    { scale: 1;     animation-timing-function: cubic-bezier(0.11, 0, 0.5, 0); }
	exit 100%  { scale: 0.92; }
}

@supports (animation-timeline: view()) {
	.message {
		animation: edge-fade both;
		animation-timeline: view(block 40px);
	}
}




.colorpanel {
	--bar: 12px;
	--gap: 8px;
	--hit: calc(var(--bar) + 8px); /* the difference this makes is suprisingly noticable */
	--full: calc(3 * var(--bar) + 2 * 8px);
	display: grid;
	gap: 8px;
	padding: 14px 5px 8px;
	box-sizing: content-box;
	height: var(--full);
	overflow: clip;
	transform-origin: center top;
	transition-property: height, padding, opacity, transform;
	transition-duration: 0.3s;
	transition-timing-function: cubic-bezier(0.5, 1, 0.89, 1);

	&:not(.open) {
		height: 0;
		padding-top: 0;
		padding-bottom: 0;
		opacity: 0;
		transform: scale(0.92);
		transition-timing-function: cubic-bezier(0.11, 0, 0.5, 0);
	}
	.hue { --track: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); }
	.sat { --track: linear-gradient(to right, var(--s0), var(--s1)); }
	.val { --track: linear-gradient(to right, var(--v0), var(--v1)); }

	.slider {
		position: relative;
		height: var(--bar);
		container-type: inline-size;
		span {
			position: absolute;
			top: 0;
			bottom: 0;
			border-radius: 999px;
			background: var(--track) 0 0 / 100cqw 100% no-repeat;
		}
		.l { left: 0; width: calc((100% - var(--gap)) * var(--p)); }
		.r { right: 0; width: calc((100% - var(--gap)) * (1 - var(--p))); background-position: 100% 0; }
		input {
			appearance: none;
			position: absolute;
			inset: -4px 0;
			width: 100%;
			height: var(--hit);
			margin: 0;
			opacity: 0;
			cursor: pointer;
			/* \ */
			&::-webkit-slider-thumb { appearance: none; width: var(--gap); }
			&::-moz-range-thumb { width: var(--gap); border: none; }
			/* \ */
		}

		&:has(input:focus-visible) {
			outline: 2px solid rgba(0, 0, 0, 0.25);
			outline-offset: 3px;
			border-radius: 999px;
		}
	}
}
