/**
 * Social Tap Elements: Tap Demo widget.
 *
 * Port of the design's "tap demo" rules. The stage is an illustration: its
 * geometry keeps physical left/right so the card always travels towards the
 * phone, and the phone screen keeps the design's literal UI colours. Picker
 * and hint values here are fallbacks; the widget's Style controls (bound to
 * Kit globals) override them.
 *
 * @package Socialtap_Elements
 */

.st-tapdemo {
	position: relative;
}

.st-tapdemo,
.st-tapdemo *,
.st-tapdemo *::before,
.st-tapdemo *::after {
	box-sizing: border-box;
}

/* ---------- stage ---------- */

.st-tapdemo__stage {
	position: relative;
	aspect-ratio: 1 / 1;
	max-width: 560px;
	margin-inline: auto;
	font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
	font-size: 17px;
	font-stretch: 100%;
	font-weight: 400;
	line-height: 1.6;
	letter-spacing: normal;
	text-align: left;
	text-transform: none;
	-webkit-font-smoothing: antialiased;
}

@media (max-width: 1024px) {

	.st-tapdemo__stage {
		max-width: 460px;
	}
}

.st-tapdemo__phone {
	position: absolute;
	top: 2%;
	right: 4%;
	width: 46%;
	aspect-ratio: 9 / 18.6;
	padding: 2.2%;
	border-radius: 13% / 6.4%;
	background: linear-gradient(160deg, #2b2e34, #0e0f12 60%);
	box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.14), 0 40px 80px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px #000;
}

.st-tapdemo__screen {
	position: relative;
	height: 100%;
	overflow: hidden;
	border-radius: 11% / 5.3%;
	background: #f4f5f7;
	color: #111317;
	container-type: inline-size;
}

.st-tapdemo__island {
	position: absolute;
	top: 2.4%;
	left: 50%;
	z-index: 3;
	width: 30%;
	height: 3.4%;
	border-radius: 20px;
	background: #000;
	transform: translateX(-50%);
}

/* ---------- phone screens ---------- */

.st-scr {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	padding: 22% 8% 8%;
	opacity: 0;
	transform: translateY(6%);
	transition: opacity 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.st-scr.is-on {
	opacity: 1;
	transform: none;
}

.st-scr.st-scr--idle {
	align-items: center;
	justify-content: center;
	padding: 8%;
	background: linear-gradient(180deg, #14161a, #0b0c0e);
	color: #c9cdd3;
	text-align: center;
}

.st-scr__clock {
	color: #eef0f3;
	font-size: 20cqw;
	font-stretch: 125%;
	font-weight: 500;
	line-height: 1;
	letter-spacing: -0.03em;
}

.st-scr--idle .st-scr__small {
	margin-top: 4%;
	color: #8c929c;
	font-size: 6cqw;
}

.st-scr__av {
	display: grid;
	place-items: center;
	width: 30cqw;
	height: 30cqw;
	margin: 0 auto 5cqw;
	border-radius: 50%;
	background: linear-gradient(140deg, #2a2d33, #0b0c0e);
	color: #fff;
	font-size: 10cqw;
	font-stretch: 125%;
	font-weight: 700;
}

.st-tapdemo .st-scr__av img {
	width: 46%;
	max-width: 100%;
	height: auto;
	margin: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

.st-scr__nm {
	font-size: 8.4cqw;
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.01em;
	text-align: center;
}

.st-scr__sub {
	margin-top: 1.5cqw;
	color: #626872;
	font-size: 5.4cqw;
	text-align: center;
}

.st-scr__pill {
	width: 100%;
	margin: 6cqw auto 0;
	padding: 3.6cqw 0;
	border-radius: 999px;
	background: #111317;
	color: #fff;
	font-size: 5.6cqw;
	font-weight: 600;
	text-align: center;
}

.st-scr__pill.st-scr__pill--alt {
	margin-top: 2.6cqw;
	background: #e8eaee;
	color: #111317;
}

.st-scr__pill.st-scr__pill--red {
	background: #e5484d;
}

.st-scr__rows {
	margin-top: 6cqw;
	border-top: 1px solid #e1e3e7;
}

.st-scr__row {
	display: flex;
	justify-content: space-between;
	gap: 3cqw;
	padding: 3.4cqw 0;
	border-bottom: 1px solid #e1e3e7;
	font-size: 5cqw;
}

.st-scr__row b {
	color: #111317;
	font-weight: 600;
}

.st-scr__row span {
	color: #6a707a;
}

.st-scr__grid9 {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1.2cqw;
	margin-top: 6cqw;
}

.st-scr__grid9 span {
	aspect-ratio: 1;
	border-radius: 1.6cqw;
	background: linear-gradient(140deg, #d7dade, #b8bdc5);
}

.st-scr__grid9 span:nth-child(2n) {
	background: linear-gradient(140deg, #2a2d33, #4a4f58);
}

.st-scr__stars {
	display: flex;
	justify-content: center;
	gap: 2cqw;
	margin-top: 7cqw;
}

.st-scr__stars svg {
	width: 11cqw;
	height: 11cqw;
	fill: #d7dae0;
	transition: fill 0.25s;
}

.st-scr__stars.is-filled svg {
	fill: #f2b400;
}

.st-scr__stars.is-filled svg:nth-child(2) {
	transition-delay: 0.12s;
}

.st-scr__stars.is-filled svg:nth-child(3) {
	transition-delay: 0.24s;
}

.st-scr__stars.is-filled svg:nth-child(4) {
	transition-delay: 0.36s;
}

.st-scr__stars.is-filled svg:nth-child(5) {
	transition-delay: 0.48s;
}

.st-scr__box {
	min-height: 24cqw;
	margin-top: 7cqw;
	padding: 3.6cqw;
	border: 1px solid #dadde2;
	border-radius: 3cqw;
	background: #fff;
	color: #8a9099;
	font-size: 4.8cqw;
}

.st-scr.st-scr--emerg {
	background: #fff6f6;
}

.st-scr__tag {
	align-self: center;
	margin-bottom: 5cqw;
	padding: 1.6cqw 4cqw;
	border-radius: 999px;
	background: #e5484d;
	color: #fff;
	font-size: 4.6cqw;
	font-weight: 700;
}

.st-scr__info {
	margin-top: 5cqw;
	padding: 3.6cqw 4cqw;
	border: 1px solid #f1dada;
	border-radius: 3.4cqw;
	background: #fff;
	font-size: 4.9cqw;
	line-height: 1.35;
}

.st-scr__info + .st-scr__info {
	margin-top: 2.4cqw;
}

.st-scr__info b {
	display: block;
	margin-bottom: 0.6cqw;
	color: #9a5a5c;
	font-size: 4.2cqw;
	font-weight: 600;
}

/* ---------- card on the stage + tap rings ---------- */

.st-tapdemo__card {
	position: absolute;
	top: 47%;
	left: -2%;
	z-index: 4;
	width: 56%;
	filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.6));
	transform: rotate(-9deg);
	transform-origin: 50% 50%;
}

.st-tapdemo__card.is-portrait {
	top: 30%;
	left: 6%;
	width: 31%;
	transform: rotate(-6deg);
}

.st-tapdemo__rings {
	position: absolute;
	top: 30%;
	left: 56%;
	z-index: 5;
	width: 0;
	height: 0;
	pointer-events: none;
}

.st-tapdemo__rings span {
	position: absolute;
	top: -70px;
	left: -70px;
	width: 140px;
	height: 140px;
	border: 2px solid rgba(240, 242, 246, 0.85);
	border-radius: 50%;
	box-shadow: 0 0 24px rgba(240, 242, 246, 0.25);
	opacity: 0;
}

/*
 * No fill-mode: the last keyframe and the resting style are both invisible, and
 * not holding scale(2.2) keeps the expanded rings from adding scroll overflow.
 */
.st-tapdemo__rings.is-go span {
	animation: st-tapdemo-ring 1.1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.st-tapdemo__rings.is-go span:nth-child(2) {
	animation-delay: 0.18s;
}

.st-tapdemo__rings.is-go span:nth-child(3) {
	animation-delay: 0.36s;
}

@keyframes st-tapdemo-ring {

	0% {
		opacity: 0.9;
		transform: scale(0.2);
	}

	100% {
		opacity: 0;
		transform: scale(2.2);
	}
}

/* ---------- picker + hint ---------- */

.st-tapdemo__picker {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin-block-start: 22px;
}

/*
 * Specificity ladder (independent of stylesheet order):
 * base normal (0,3,0) < Style-tab normal (0,4,0) < base hover / pressed (0,5,0)
 * < Style-tab hover / pressed (0,6,0). Three classes also beat Hello's reset
 * and the Kit's button styles.
 */
.st-tapdemo .st-tapdemo__picker .st-tapdemo__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: auto;
	height: 40px;
	min-height: 0;
	margin: 0;
	padding: 0 16px;
	border: 1px solid rgba(236, 238, 242, 0.18);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.02);
	box-shadow: none;
	color: #a6acb6;
	font: inherit;
	font-size: 14px;
	line-height: 1.2;
	letter-spacing: normal;
	text-decoration: none;
	text-transform: none;
	white-space: nowrap;
	cursor: pointer;
	transition: color 0.2s, background-color 0.2s, border-color 0.2s;
}

.st-tapdemo .st-tapdemo__picker .st-tapdemo__btn:hover:not([aria-pressed="true"]) {
	border-color: rgba(255, 255, 255, 0.3);
	color: #f1f3f5;
}

.st-tapdemo.st-tapdemo .st-tapdemo__picker .st-tapdemo__btn[aria-pressed="true"] {
	border-color: #f1f3f5;
	background: #f1f3f5;
	color: #0a0b0d;
}

.st-tapdemo .st-tapdemo__picker .st-tapdemo__btn:focus-visible {
	outline: 2px solid #f3f4f6;
	outline-offset: 3px;
	box-shadow: none;
}

.st-tapdemo .st-tapdemo__hint {
	margin: 14px 0 0;
	color: #7c828c;
	font-size: 14px;
	text-align: center;
}

/* ---------- reduced motion: instant swaps, no rings ---------- */

@media (prefers-reduced-motion: reduce) {

	.st-scr,
	.st-scr__stars svg,
	.st-tapdemo .st-tapdemo__picker .st-tapdemo__btn {
		transition: none;
	}

	.st-tapdemo__rings.is-go span {
		animation: none;
	}
}
