/*
 * PureCSS.com
 * https://purecss.com/tactile-button/
 * A button with physical depth, built from stacked box-shadow layers.
 */

.demo-tactile-button {
	flex-wrap: wrap;
	gap: 1rem;
}

.demo-tactile-button .tb-button {
	padding: .75rem 1.4rem;
	border: 0;
	border-radius: 12px;
	font: inherit;
	font-weight: 600;
	color: #f4f4f5;
	cursor: pointer;
	background: linear-gradient(#3b3b42, #26262b);
	/* read from the top: top edge catching light, bottom edge in shade, contact shadow, cast shadow */
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, .2),
		inset 0 -2px 0 rgba(0, 0, 0, .35),
		0 1px 1px rgba(0, 0, 0, .5),
		0 6px 14px rgba(0, 0, 0, .4);
	transition: transform .12s, box-shadow .12s, filter .12s;
}

.demo-tactile-button .tb-accent {
	color: #16210a;
	background: linear-gradient(#caff7a, #9fe63e);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, .6),
		inset 0 -2px 0 rgba(60, 100, 0, .35),
		0 1px 1px rgba(0, 0, 0, .5),
		0 6px 14px rgba(120, 190, 30, .3);
}

.demo-tactile-button .tb-button:hover {
	filter: brightness(1.08);
}

.demo-tactile-button .tb-button:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 3px;
}

/* pressing tightens the outer shadows and turns the light inward, so the button sinks */
.demo-tactile-button .tb-button:active {
	transform: translateY(2px);
	box-shadow:
		inset 0 2px 5px rgba(0, 0, 0, .5),
		inset 0 -1px 0 rgba(255, 255, 255, .08),
		0 0 0 rgba(0, 0, 0, 0),
		0 1px 2px rgba(0, 0, 0, .3);
}

/* ── Variant: layer by layer ── */

.demo-tactile-button .tb-layers {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 1rem;
}

.demo-tactile-button .tb-layer {
	padding: .6rem 1rem;
	border-radius: 12px;
	font-family: var(--font-mono);
	font-size: .75rem;
	color: #f4f4f5;
	background: linear-gradient(#3b3b42, #26262b);
}

.demo-tactile-button .tb-layer-2 { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2); }
.demo-tactile-button .tb-layer-3 { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), inset 0 -2px 0 rgba(0, 0, 0, .35); }
.demo-tactile-button .tb-layer-4 { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), inset 0 -2px 0 rgba(0, 0, 0, .35), 0 1px 1px rgba(0, 0, 0, .5), 0 6px 14px rgba(0, 0, 0, .4); }
