/*
 * PureCSS.com
 * https://purecss.com/glassmorphism/
 * A frosted glass card: backdrop-filter blur and saturate over a vivid scene, a thin tinted fill, a fine light edge.
 */

/* the scene is pinned, not themed: glass only reads over strong color */
.demo-glassmorphism .gm-scene {
	position: relative;
	isolation: isolate;
	display: grid;
	place-items: center;
	width: min(100%, 34rem);
	height: 22rem;
	overflow: hidden;
	border-radius: 18px;
	background: linear-gradient(140deg, #1b1446, #2a1060 55%, #3d0f4f);
}

/* hard-edged shapes, so the edge of the glass shows sharp outside and soft inside */
.demo-glassmorphism .gm-orb {
	position: absolute;
	z-index: -1;
	border-radius: 50%;
	animation: gm-drift var(--gm-time, 16s) ease-in-out infinite alternate;
}

.demo-glassmorphism .gm-orb-1 {
	top: -2rem;
	left: 8%;
	width: 12rem;
	height: 12rem;
	background: linear-gradient(135deg, #ff5fa2, #c026d3);
	--gm-dx: 4rem;
	--gm-dy: 3rem;
}

.demo-glassmorphism .gm-orb-2 {
	right: 6%;
	bottom: -2.5rem;
	width: 10rem;
	height: 10rem;
	background: linear-gradient(135deg, #ffc247, #ff5e3a);
	--gm-dx: -5rem;
	--gm-dy: -3rem;
	--gm-time: 19s;
}

.demo-glassmorphism .gm-orb-3 {
	top: 18%;
	right: 12%;
	width: 6rem;
	height: 6rem;
	background: linear-gradient(135deg, #3ee0ff, #3b6bff);
	--gm-dx: -3rem;
	--gm-dy: 5rem;
	--gm-time: 13s;
}

@keyframes gm-drift {
	to { translate: var(--gm-dx) var(--gm-dy); }
}

/* the glass: a thin tint, the blur and saturate behind it, a fine edge lit from the top */
.demo-glassmorphism .gm-card {
	position: relative;
	width: min(84%, 19rem);
	padding: 1.4rem 1.5rem 1.5rem;
	border: 1px solid rgba(255, 255, 255, .28);
	border-top-color: rgba(255, 255, 255, .55);
	border-radius: 20px;
	color: #fff;
	background: linear-gradient(150deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .04) 60%), rgba(18, 12, 44, .5);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 1.2rem 2.5rem rgba(8, 4, 28, .45);
	-webkit-backdrop-filter: blur(16px) saturate(180%);
	backdrop-filter: blur(16px) saturate(180%);
}

.demo-glassmorphism .gm-kicker {
	margin: 0;
	font-size: .72rem;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
}

.demo-glassmorphism .gm-title {
	margin: .35rem 0 .5rem;
	font-size: 1.55rem;
	font-weight: 800;
	line-height: 1.15;
}

.demo-glassmorphism .gm-text {
	margin: 0;
	font-size: .92rem;
	line-height: 1.55;
}

.demo-glassmorphism .gm-tags {
	display: flex;
	flex-wrap: wrap;
	gap: .4rem;
	margin: 1rem 0 0;
	padding: 0;
	list-style: none;
}

.demo-glassmorphism .gm-tags li {
	padding: .25rem .6rem;
	border: 1px solid rgba(255, 255, 255, .3);
	border-radius: 99px;
	font-family: var(--font-mono);
	font-size: .72rem;
	background: rgba(18, 12, 44, .3);
}

/* the home card: the scene fills the pane */
.card-preview .demo-glassmorphism {
	width: 100%;
}

.card-preview .demo-glassmorphism .gm-scene {
	width: 100%;
	height: 180px;
	border-radius: 0;
}

.card-preview .demo-glassmorphism .gm-orb-1 {
	top: -3rem;
	left: 4%;
	width: 9rem;
	height: 9rem;
}

.card-preview .demo-glassmorphism .gm-orb-2 {
	bottom: -3rem;
	width: 7.5rem;
	height: 7.5rem;
}

.card-preview .demo-glassmorphism .gm-orb-3 {
	top: 8%;
	width: 4.5rem;
	height: 4.5rem;
}

.card-preview .demo-glassmorphism .gm-card {
	width: 62%;
	padding: .8rem 1rem .9rem;
	border-radius: 16px;
}

.card-preview .demo-glassmorphism .gm-title {
	margin: .2rem 0 .45rem;
	font-size: 1.15rem;
}

.card-preview .demo-glassmorphism .gm-tags {
	margin: 0;
}

/* ── Variant: a glass sign-in form ── */

.demo-glassmorphism .gm-scene-form {
	height: 27rem;
}

.demo-glassmorphism .gm-form {
	display: grid;
	gap: .9rem;
}

.demo-glassmorphism .gm-form .gm-title {
	margin: 0 0 .1rem;
}

.demo-glassmorphism .gm-field {
	display: grid;
	gap: .35rem;
	font-size: .85rem;
	font-weight: 600;
}

.demo-glassmorphism .gm-field input {
	width: 100%;
	box-sizing: border-box;
	padding: .65rem .8rem;
	border: 1px solid rgba(255, 255, 255, .32);
	border-radius: 10px;
	font: inherit;
	font-weight: 400;
	color: #fff;
	background: rgba(18, 12, 44, .55);
}

.demo-glassmorphism .gm-field input::placeholder {
	color: rgba(255, 255, 255, .8);
}

.demo-glassmorphism .gm-btn {
	margin-top: .35rem;
	padding: .7rem 1rem;
	border: 0;
	border-radius: 10px;
	font: inherit;
	font-weight: 700;
	color: #1b1446;
	background: #fff;
	cursor: pointer;
}

.demo-glassmorphism .gm-btn:hover {
	background: rgba(255, 255, 255, .85);
}

.demo-glassmorphism .gm-field input:focus-visible,
.demo-glassmorphism .gm-btn:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

/* ── Variant: stacked panels for depth ── */

.demo-glassmorphism .gm-stack {
	position: relative;
	width: min(88%, 22rem);
	height: 16.5rem;
}

/* each layer sets its own blur and tint; further back is clearer and thinner */
.demo-glassmorphism .gm-layer {
	position: absolute;
	width: 72%;
	height: 8.5rem;
	padding: .9rem 1rem;
	box-sizing: border-box;
	background: linear-gradient(150deg, rgba(255, 255, 255, var(--gm-sheen)), rgba(255, 255, 255, 0) 60%), rgba(18, 12, 44, var(--gm-tint));
	-webkit-backdrop-filter: blur(var(--gm-blur)) saturate(180%);
	backdrop-filter: blur(var(--gm-blur)) saturate(180%);
}

.demo-glassmorphism .gm-layer-back {
	top: 0;
	left: 0;
	--gm-blur: 4px;
	--gm-tint: .45;
	--gm-sheen: .06;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 .5rem 1rem rgba(8, 4, 28, .3);
}

.demo-glassmorphism .gm-layer-mid {
	top: 4rem;
	left: 14%;
	--gm-blur: 10px;
	--gm-tint: .5;
	--gm-sheen: .12;
}

.demo-glassmorphism .gm-layer-front {
	top: 8rem;
	left: 28%;
	--gm-blur: 22px;
	--gm-tint: .55;
	--gm-sheen: .2;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 1.6rem 3rem rgba(8, 4, 28, .55);
}

.demo-glassmorphism .gm-layer-name {
	margin: 0;
	font-weight: 800;
}

.demo-glassmorphism .gm-layer-spec {
	margin: .2rem 0 0;
	font-family: var(--font-mono);
	font-size: .72rem;
}

/* ── Variant: dark tint and light tint ── */

.demo-glassmorphism .gm-scene-pair {
	width: min(100%, 40rem);
	height: auto;
	min-height: 22rem;
	padding: 2.5rem 0;
	box-sizing: border-box;
}

.demo-glassmorphism .gm-pair {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr));
	gap: 1.25rem;
	width: 90%;
}

.demo-glassmorphism .gm-pair .gm-card {
	width: auto;
}

.demo-glassmorphism .gm-light {
	border-color: rgba(255, 255, 255, .6);
	border-top-color: rgba(255, 255, 255, .9);
	color: #17112f;
	background: linear-gradient(150deg, rgba(255, 255, 255, .25), rgba(255, 255, 255, 0) 60%), rgba(255, 255, 255, .55);
}

.demo-glassmorphism .gm-light .gm-tags li {
	border-color: rgba(23, 17, 47, .3);
	background: rgba(255, 255, 255, .35);
}

/* no blur at all: a nearly solid tint keeps the text readable. Both spellings,
   or a browser with only the prefixed one would lose its blur to the fallback. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	.demo-glassmorphism .gm-card {
		background: rgba(24, 16, 56, .92);
	}

	.demo-glassmorphism .gm-light {
		background: rgba(255, 255, 255, .92);
	}
}

@media (prefers-reduced-motion: reduce) {
	.demo-glassmorphism .gm-orb {
		animation: none;
	}
}
