/**
 * Visual lab — section 03: ecosystem teaser.
 */

.hp-lab-ecosystem {
	--hp-lab-ecosystem-gap: clamp(1.25rem, 3vw, 2.5rem);
	/* Szerokość kolumny przy pełnym kontenerze lab (1200px) — identyczna na PC, tablecie i mobile. */
	--hp-lab-ecosystem-col-w: calc((1150px - 4 * 2.5rem - 2px) / 3);
	background: var(--hp-bg);
}

.hp-lab-ecosystem__columns {
	display: grid;
	grid-template-columns: var(--hp-lab-ecosystem-col-w) auto var(--hp-lab-ecosystem-col-w) auto var(--hp-lab-ecosystem-col-w);
	justify-content: center;
	align-items: center;
	gap: var(--hp-lab-ecosystem-gap);
}

.hp-lab-ecosystem__divider {
	width: 1px;
	align-self: stretch;
	min-height: 22rem;
	background: linear-gradient(
		to bottom,
		transparent,
		color-mix(in srgb, var(--hp-lab-ecosystem-color, #fff) 35%, transparent) 25%,
		color-mix(in srgb, var(--hp-lab-ecosystem-color, #fff) 35%, transparent) 75%,
		transparent
	);
}

.hp-lab-ecosystem__col {
	position: relative;
	display: flex;
	align-items: center;
	width: var(--hp-lab-ecosystem-col-w);
	max-width: 100%;
}

.hp-lab-ecosystem__col-box {
	position: relative;
	width: 100%;
	overflow: hidden;
	border-radius: 2px;
	box-shadow:
		0 0 10px rgba(255, 255, 255, 0.14),
		0 0 24px rgba(255, 255, 255, 0.07);
	transition:
		transform 0.28s ease,
		box-shadow 0.28s ease;
}

.hp-lab-ecosystem__col-inner {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	min-height: 24rem;
	padding: 5.3rem 1.5rem 5.55rem;
	background: #000;
	color: #fff;
	--hp-lab-ecosystem-tagline-size: clamp(1.15rem, 2vw, 1.35rem);
	--hp-lab-ecosystem-tagline-leading: 1.3;
	--hp-lab-ecosystem-line-gap: calc(var(--hp-lab-ecosystem-tagline-size) * var(--hp-lab-ecosystem-tagline-leading));
	transition:
		background 0.28s ease,
		color 0.28s ease;
}

/* Efekty hover — poza układem, niewidoczne w spoczynku */
.hp-lab-ecosystem__hover-fx {
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: none;
	visibility: hidden;
	opacity: 0;
}

.hp-lab-ecosystem__col-inner::after {
	content: none;
}

.hp-lab-ecosystem__col:is(:hover, :focus-within, .hp-lab-ecosystem__col--centered) .hp-lab-ecosystem__col-inner {
	--project-color: var(--hp-lab-ecosystem-color, #fff);
	--wc-gold: color-mix(in srgb, var(--project-color) 72%, #d2b073);
	overflow: hidden;
	isolation: isolate;
	border: 2px solid var(--hp-lab-ecosystem-color, var(--project-color));
	background: #fff;
	color: #000;
	box-shadow: 0 0 1.5em color-mix(in srgb, var(--project-color) 24%, transparent);
	transition:
		background 0.28s ease,
		color 0.28s ease,
		border-color 0.4s ease,
		box-shadow 0.4s ease;
}

.hp-lab-ecosystem__col:is(:hover, :focus-within, .hp-lab-ecosystem__col--centered) .hp-lab-ecosystem__col-inner::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	background:
		radial-gradient(ellipse 88% 78% at 50% 42%, transparent 0%, rgba(0, 0, 0, 0.62) 100%),
		#fff;
}

.hp-lab-ecosystem__col:is(:hover, :focus-within, .hp-lab-ecosystem__col--centered) .hp-lab-ecosystem__hover-fx {
	visibility: visible;
	opacity: 1;
	transition: opacity 0.28s ease;
}

.hp-lab-ecosystem__hover-glass {
	position: absolute;
	inset: 0.55em;
	z-index: 1;
	background: rgba(255, 255, 255, 0.18);
	border: 1px solid rgba(255, 255, 255, 0.28);
	-webkit-backdrop-filter: blur(7px) saturate(125%);
	backdrop-filter: blur(7px) saturate(125%);
}

.hp-lab-ecosystem__frame-corner {
	position: absolute;
	z-index: 2;
	width: 2em;
	height: 2em;
	border: 0.15em solid var(--wc-gold);
	transition:
		width 0.4s ease,
		height 0.4s ease,
		border-color 0.4s ease;
}

.hp-lab-ecosystem__frame-corner--top-left {
	top: 0.65em;
	left: 0.65em;
	border-right: none;
	border-bottom: none;
}

.hp-lab-ecosystem__frame-corner--top-right {
	top: 0.65em;
	right: 0.65em;
	border-left: none;
	border-bottom: none;
}

.hp-lab-ecosystem__frame-corner--bottom-left {
	bottom: 0.65em;
	left: 0.65em;
	border-right: none;
	border-top: none;
}

.hp-lab-ecosystem__frame-corner--bottom-right {
	bottom: 0.65em;
	right: 0.65em;
	border-left: none;
	border-top: none;
}

.hp-lab-ecosystem__col:is(:hover, :focus-within, .hp-lab-ecosystem__col--centered) .hp-lab-ecosystem__logo,
.hp-lab-ecosystem__col:is(:hover, :focus-within, .hp-lab-ecosystem__col--centered) .hp-lab-ecosystem__content,
.hp-lab-ecosystem__col:is(:hover, :focus-within, .hp-lab-ecosystem__col--centered) .hp-lab-ecosystem__cta {
	position: relative;
	z-index: 3;
}

.hp-lab-ecosystem__col:is(:hover, .hp-lab-ecosystem__col--centered) {
	z-index: 4;
}

.hp-lab-ecosystem__col:is(:hover, :focus-within, .hp-lab-ecosystem__col--centered) .hp-lab-ecosystem__col-box {
	transform: scale(1.045) translateY(-4px);
	box-shadow: none;
}

.hp-lab-ecosystem__col:is(:hover, :focus-within, .hp-lab-ecosystem__col--centered) .hp-lab-ecosystem__frame-corner {
	width: 90%;
	height: 90%;
	border-color: color-mix(in srgb, var(--wc-gold) 48%, transparent);
}

.hp-lab-ecosystem__col:is(:hover, :focus-within, .hp-lab-ecosystem__col--centered) .hp-lab-ecosystem__logo {
	filter: drop-shadow(0 0 8px var(--hp-lab-ecosystem-color))
		drop-shadow(0 0 16px color-mix(in srgb, var(--hp-lab-ecosystem-color) 55%, transparent));
}

.hp-lab-ecosystem__col:is(:hover, :focus-within, .hp-lab-ecosystem__col--centered) .hp-lab-ecosystem__cta {
	color: #000;
	background: #fff;
	border-color: #000;
	box-shadow: none;
}

.hp-lab-ecosystem__logo {
	display: block;
	width: 5rem;
	height: auto;
	margin: 0 auto var(--hp-lab-ecosystem-line-gap);
	filter: none;
	transition: filter 0.28s ease;
}

.hp-lab-ecosystem__content {
	position: relative;
	display: grid;
	grid-template-areas: 'copy';
	flex: 1;
	width: 100%;
	min-height: 0;
	height: 100%;
	margin: 0 0 var(--hp-lab-ecosystem-line-gap);
}

.hp-lab-ecosystem__taglines,
.hp-lab-ecosystem__detail {
	grid-area: copy;
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	height: 100%;
	min-height: 0;
	transition: opacity 0.28s ease, visibility 0.28s ease;
}

.hp-lab-ecosystem__taglines:not(.hp-lab-ecosystem__taglines--back) {
	height: 100%;
	justify-content: space-evenly;
	opacity: 1;
	visibility: visible;
}

.hp-lab-ecosystem__taglines--back {
	gap: var(--hp-lab-ecosystem-line-gap);
	justify-content: flex-start;
}

.hp-lab-ecosystem__taglines p {
	margin: 0;
	font-size: var(--hp-lab-ecosystem-tagline-size);
	line-height: var(--hp-lab-ecosystem-tagline-leading);
	text-align: center;
	color: inherit;
	opacity: 0.42;
	text-shadow: none;
	transition:
		opacity 0.75s ease-in-out,
		text-shadow 0.75s ease-in-out,
		color 0.75s ease-in-out;
}

.hp-lab-ecosystem__taglines:not(.hp-lab-ecosystem__taglines--back) p.hp-lab-ecosystem__tagline--active {
	opacity: 1;
	text-shadow:
		0 0 8px color-mix(in srgb, var(--hp-lab-ecosystem-color) 85%, transparent),
		0 0 20px color-mix(in srgb, var(--hp-lab-ecosystem-color) 55%, transparent);
}

.hp-lab-ecosystem__detail {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.hp-lab-ecosystem__col:is(:hover, :focus-within, .hp-lab-ecosystem__col--centered) .hp-lab-ecosystem__taglines:not(.hp-lab-ecosystem__taglines--back) {
	opacity: 0;
	visibility: hidden;
}

.hp-lab-ecosystem__col:is(:hover, :focus-within, .hp-lab-ecosystem__col--centered) .hp-lab-ecosystem__detail {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.hp-lab-ecosystem__taglines--back p {
	opacity: 0.42;
	color: #000;
	text-shadow: none;
}

.hp-lab-ecosystem__taglines--back p.hp-lab-ecosystem__tagline--active {
	opacity: 1;
	color: #000;
	text-shadow:
		0 0 8px rgba(0, 0, 0, 0.85),
		0 0 20px rgba(0, 0, 0, 0.45);
}

.hp-lab-ecosystem__cta {
	display: inline-block;
	flex-shrink: 0;
	padding: 0.55rem 1.35rem;
	font: inherit;
	font-size: 0.9rem;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	color: #fff;
	background: #000;
	border: 1px solid #fff;
	border-radius: 999px;
	transition:
		color 0.28s ease,
		background 0.28s ease,
		border-color 0.28s ease,
		box-shadow 0.28s ease,
		transform 0.28s ease;
}

.hp-lab-ecosystem__cta:hover,
.hp-lab-ecosystem__cta:focus-visible {
	position: relative;
	z-index: 5;
	color: #000;
	background: #fff;
	border-color: #000;
	box-shadow: 0 0 16px rgba(0, 0, 0, 0.85);
	text-shadow: none;
	transform: translateY(-3px);
}

.hp-lab-ecosystem__col:hover .hp-lab-ecosystem__cta:hover,
.hp-lab-ecosystem__col:hover .hp-lab-ecosystem__cta:focus-visible,
.hp-lab-ecosystem__col:focus-within .hp-lab-ecosystem__cta:hover,
.hp-lab-ecosystem__col:focus-within .hp-lab-ecosystem__cta:focus-visible {
	color: #fff;
	background: #000;
	border-color: #fff;
	box-shadow: 0 0 16px rgba(0, 0, 0, 0.85);
}

@media (max-width: 1200px) {
	.hp-lab-ecosystem__columns {
		grid-template-columns: 1fr;
		justify-items: center;
	}

	.hp-lab-ecosystem__col {
		width: min(100%, var(--hp-lab-ecosystem-col-w));
	}

	.hp-lab-ecosystem__divider {
		width: min(100%, var(--hp-lab-ecosystem-col-w));
		height: 1px;
		min-height: 0;
		background: linear-gradient(
			to right,
			transparent,
			color-mix(in srgb, var(--hp-lab-ecosystem-color, #fff) 35%, transparent) 25%,
			color-mix(in srgb, var(--hp-lab-ecosystem-color, #fff) 35%, transparent) 75%,
			transparent
		);
	}
}

@media (prefers-reduced-motion: reduce) {
	.hp-lab-ecosystem__taglines:not(.hp-lab-ecosystem__taglines--back) p,
	.hp-lab-ecosystem__taglines--back p {
		opacity: 1;
		color: inherit;
		text-shadow: none;
		transition: none;
	}

	.hp-lab-ecosystem__taglines--back p {
		color: #000;
	}

	.hp-lab-ecosystem__hover-fx,
	.hp-lab-ecosystem__frame-corner {
		transition: none;
	}

	.hp-lab-ecosystem__col:is(:hover, :focus-within, .hp-lab-ecosystem__col--centered) .hp-lab-ecosystem__hover-fx {
		visibility: visible;
		opacity: 1;
	}

	.hp-lab-ecosystem__col:is(:hover, :focus-within, .hp-lab-ecosystem__col--centered) .hp-lab-ecosystem__frame-corner {
		width: 90%;
		height: 90%;
	}
}
