@font-face {
  font-family: "Nunito";
  src: url("fonts/Nunito.ttf");
}
/* @font-face {
  font-family: "Spectral";
  src: url("fonts/Spectral-Italic.ttf");
} */
@font-face {
  font-family: "Spectral SC";
  src: url("fonts/SpectralSC-Medium.ttf");
}
* {
	border: 0;
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}
:root {
	--hue: 223;
	--bg: hsl(0,0%,100%);
	--fg: hsl(var(--hue),10%,10%);
	--trans-dur: 0.3s;
	--trans-timing1: cubic-bezier(0.37,0,0.63,1);
	--trans-timing2: cubic-bezier(0.34,1.56,0.64,1);
	font-size: calc(16px + (24 - 16) * (100vw - 320px) / (2560 - 320));
}
.popup {
  position: fixed;
  top: 50%; /* vertical centering */
  left: 50%; /* horizontal centering */
  transform: translate(-50%, -50%); /* adjusts position based on element size */
  background-color: #000;
  padding: 25px 25px 25px 33px;
  border: 3px solid #ccc;
  border-radius: 10px; /* rounded corners */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
  z-index: 10; /* ensures popup appears above other content */
}
li {
  margin-left: 20px;
}
code {
  font-family: monospace, courier new, monospace;
  font-size: 0.833em !important;
  color: #000;
  background-color: #f5f5f5;
  padding: 2px 9px; 
  border: 2px solid #bbb;
  border-radius: 3px;
}
.button-container {
  display: flex;
/*   justify-content: space-around; */
}
a {
  text-decoration: none;
}
body,
button,
input {
	color: var(--fg);
	font: 1em/1.5 Nunito, sans-serif;
	transition:
		background-color var(--trans-dur) var(--trans-timing1),
		box-shadow var(--trans-dur) var(--trans-timing1),
		color var(--trans-dur) var(--trans-timing1);
}
body {
	background-color: var(--bg);
	display: flex;
	height: 100vh;
}
h2 {
    font-family: "Spectral SC";
}
h3 {
	font-size: 1.25em;
	font-weight: 800;
}
form {
	margin: auto;
	padding: 0.5em 0;
	width: calc(100% - 3em);
	max-width: 36em;
}
#rainbow {
/*   background: rgb(102,51,139); */
  background: linear-gradient(90deg, rgba(102,51,139,1) 0%, rgba(253,216,23,1) 8.3%, rgba(244,174,200,1) 24.9%, rgba(123,204,229,1) 33.2%, rgba(148,85,22,1) 41.5%, rgba(0,0,0,1) 49.8%, rgba(226,32,22,1) 58.6%, rgba(242,137,23,1) 66.9%, rgba(239,229,36,1) 75.2%, rgba(120,184,42,1) 83.5%, rgba(44,88,164,1) 91.8%, rgba(109,35,128,1) 100%); /* rgba(255,255,255,1) 16.6% */ 
  border-radius: 5px;
  padding: 5px 15px;
/*   background-clip: text; */
  color: white;
/*   -webkit-text-stroke: 1px purple; */
}
.btn {
	background-color: transparent;
	border-radius: 0.25rem;
	box-shadow: 0 0 0 1px hsl(var(--hue),10%,80%) inset;
	cursor: pointer;
	display: flex;
	justify-content: center;
	align-items: center;
	font-size: 0.833em;
	line-height: 1.8;
	margin-inline-start: auto;
	padding: 0 0.5rem;
}
.btn:hover {
	background-color: hsl(var(--hue),10%,95%);
}
.btn-success {
	background-color: hsl(133,90%,30%);
	box-shadow: 0 0 0 1px hsl(133,90%,30%) inset;
	color: var(--bg);
}
.btn-success:hover {
	background-color: hsl(133,90%,20%);
	box-shadow: 0 0 0 1px hsl(133,90%,20%) inset;
}
.btn-lg {
	font-size: 1.2em;
	line-height: 1.5;
	padding: 0.63em 1.5em;
	width: 100%;
}
.grid {
	display: grid;
	grid-gap: 1em;
	margin-bottom: 1em;
}
.grid-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	margin-bottom: 0.25em;
}
.icon {
	flex-shrink: 0;
	width: 1em;
	height: 1em;
}
.btn .icon {
	margin-inline-end: 0.5em;
}
.item-input,
.item-label {
	box-shadow: 0 0 0 2px hsl(var(--hue),10%,80%) inset;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.item-input {
	border-radius: 50%;
	position: absolute;
	top: 0.875em;
	right: 1em;
	width: 1em;
	height: 1em;
	-webkit-appearance: none;
	appearance: none;
}
[dir="rtl"] .item-input {
	right: auto;
	left: 1em;
}
.item-input:before {
	background-color: hsl(0,0%,100%);
	border-radius: inherit;
	box-shadow: 0 0 0 0.3em hsl(var(--hue),90%,50%);
	content: "";
	display: block;
	position: absolute;
	top: 0.3em;
	left: 0.3em;
	width: 0.4em;
	height: 0.4em;
	transition: transform var(--trans-dur) var(--trans-timing1);
	transform: scale(0);
}
.item-label {
	border-radius: 0.375em;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding: 0.75em 1em;
	padding-inline-end: 2em;
	position: relative;
	transition:
		background-color var(--trans-dur) var(--trans-timing1),
		box-shadow var(--trans-dur) var(--trans-timing1);
}
.item-label:hover {
	background-color: hsl(var(--hue),10%,95%);
}
.item-label .icon {
	color: var(--fg);
	position: absolute;
	top: 0.75em;
	left: 1em;
	margin: 0.25em 0;
}
.item-label:has(.icon) {
	padding-inline-start: 2.75em;
}
[dir="rtl"] .item-label .icon {
	right: 1em;
	left: auto;
}
.item-name,
.item-price,
.item-shipping,
.item-label .icon {
	transition: color var(--trans-dur) var(--trans-timing1);
}
.item-name,
.item-price {
	color: var(--fg);
}
.item-name {
	margin-inline-end: 0.5em;
}
.item-price {
	display: inline-block;
	font-weight: 500;
	margin-top: 0.75em;
}
.item-shipping {
	color: hsl(var(--hue),10%,40%);
	font-size: 0.833em;
	line-height: 1.8;
}
/* `:checked` state */
.item-input:checked:before {
	transform: scale(1);
	transition-timing-function: var(--trans-timing2);
}
.item-input:checked ~ .icon,
.item-input:checked ~ .item-info .item-name,
.item-input:checked ~ .item-info .item-shipping,
.item-input:checked ~ .item-price {
	color: hsl(var(--hue),90%,50%);
}
.item-label:has(.item-input:checked) {
	background-color: hsl(var(--hue),90%,95%);
	box-shadow: 0 0 0 2px hsl(var(--hue),90%,50%) inset;
}

/* Dark theme */
@media (prefers-color-scheme: dark) {
	:root {
		--bg: hsl(var(--hue),10%,10%);
		--fg: hsl(var(--hue),10%,90%);
	}
	.btn {
		box-shadow: 0 0 0 1px hsl(var(--hue),10%,30%) inset;
	}
	.btn:hover {
		background-color: hsl(var(--hue),10%,20%);
		box-shadow: 0 0 0 1px hsl(var(--hue),10%,40%) inset;
	}
	.btn-success {
		background-color: hsl(133,90%,40%);
		box-shadow: 0 0 0 1px hsl(133,90%,40%) inset;
        border: 4px solid hsl(133,90%,30%);
		color: var(--bg);
        margin-bottom: 1em;
	}
	.btn-success:hover {
		background-color: hsl(133,90%,37%);
		box-shadow: 0 0 0 1px hsl(133,90%,30%) inset;
        font-weight: bold;
	}
    .btn-fail {
        box-shadow: 0 0 0 1px hsl(358.47, 71%, 53%) inset;
        border: 2px solid hsl(358.47, 71%, 43%);
    }
	.btn-fail:hover {
		background-color: hsl(358.47, 71%, 43%);
		box-shadow: 0 0 0 1px hsl(358.47, 71%, 43%) inset;
        border: 3px solid hsl(358.47, 71%, 23%);
	}
    .btn-samw {
        box-shadow: 0 0 0 1px #9C27B0 inset;
        border: 2px solid #9C27B0;
    }
    .btn-samw:hover {
		background-color: #9C27B0;
		box-shadow: 0 0 0 1px #5D1769 inset;
        border: 3px solid #5D1769;
	}
	.item-input,
	.item-label {
		box-shadow: 0 0 0 2px hsl(var(--hue),10%,30%) inset;
	}
	.item-label:hover {
		background-color: hsl(var(--hue),10%,20%);
		box-shadow: 0 0 0 2px hsl(var(--hue),10%,40%) inset;
	}
	.item-shipping {
		color: hsl(var(--hue),10%,60%);
	}
	/* `:checked` state */
	.item-input:checked ~ .icon,
	.item-input:checked ~ .item-info .item-name,
	.item-input:checked ~ .item-info .item-shipping,
	.item-input:checked ~ .item-price {
		color: hsl(var(--hue),90%,70%);
	}
	.item-label:has(.item-input:checked) {
		background-color: hsl(var(--hue),90%,15%);
	}
}

@media (prefers-color-scheme: light) {
	:root {
		--bg: hsl(var(--hue),10%,10%);
		--fg: hsl(var(--hue),10%,90%);
	}
	.btn {
		box-shadow: 0 0 0 1px hsl(var(--hue),10%,30%) inset;
	}
	.btn:hover {
		background-color: hsl(var(--hue),10%,20%);
		box-shadow: 0 0 0 1px hsl(var(--hue),10%,40%) inset;
	}
	.btn-success {
		background-color: hsl(133,90%,40%);
		box-shadow: 0 0 0 1px hsl(133,90%,40%) inset;
        border: 4px solid hsl(133,90%,30%);
		color: var(--bg);
        margin-bottom: 1em;
	}
	.btn-success:hover {
		background-color: hsl(133,90%,37%);
		box-shadow: 0 0 0 1px hsl(133,90%,30%) inset;
        font-weight: bold;
	}
    .btn-fail {
        box-shadow: 0 0 0 1px hsl(358.47, 71%, 53%) inset;
        border: 2px solid hsl(358.47, 71%, 43%);
    }
	.btn-fail:hover {
		background-color: hsl(358.47, 71%, 43%);
		box-shadow: 0 0 0 1px hsl(358.47, 71%, 43%) inset;
        border: 3px solid hsl(358.47, 71%, 23%);
	}
    .btn-samw {
        box-shadow: 0 0 0 1px #9C27B0 inset;
        border: 2px solid #9C27B0;
    }
    .btn-samw:hover {
		background-color: #9C27B0;
		box-shadow: 0 0 0 1px #5D1769 inset;
        border: 3px solid #5D1769;
	}
	.item-input,
	.item-label {
		box-shadow: 0 0 0 2px hsl(var(--hue),10%,30%) inset;
	}
	.item-label:hover {
		background-color: hsl(var(--hue),10%,20%);
		box-shadow: 0 0 0 2px hsl(var(--hue),10%,40%) inset;
	}
	.item-shipping {
		color: hsl(var(--hue),10%,60%);
	}
	/* `:checked` state */
	.item-input:checked ~ .icon,
	.item-input:checked ~ .item-info .item-name,
	.item-input:checked ~ .item-info .item-shipping,
	.item-input:checked ~ .item-price {
		color: hsl(var(--hue),90%,70%);
	}
	.item-label:has(.item-input:checked) {
		background-color: hsl(var(--hue),90%,15%);
	}
}

/* Tablet, Desktop */
@media (min-width: 768px) {
	.grid-2 {
		grid-template-columns: repeat(2,1fr);
	}
	.grid-3 {
		grid-template-columns: repeat(3,1fr);
	}
}