/**
 * Technology Page
 *
 * Page-specific composition for the EULAI Core Technology page.
 *
 * Responsibilities:
 * - Core Technology sticky introduction
 * - Core Technology numbered content stack
 * - Technology page responsive composition
 */


/* --------------------------------------------------------------
   Core Technology
-------------------------------------------------------------- */

.technology-core {
	--technology-stack-top: 8rem;
	--technology-stage-height: 28rem;
	--technology-scroll-distance: 40rem;
}

.technology-core__layout {
	display: grid;
	grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
	gap: clamp(4rem, 7vw, 8rem);
	align-items: start;
}


/* --------------------------------------------------------------
   Core Technology — Sticky Introduction
-------------------------------------------------------------- */

.technology-core__header {
	position: relative;
	align-self: stretch;
	min-width: 0;
}

.technology-core__header-inner {
	position: sticky;
	top: var(--technology-stack-top);
	height: var(--technology-stage-height);
}

.technology-core__intro {
	margin-top: clamp(1.5rem, 2.5vw, 2.25rem);
}


/* --------------------------------------------------------------
   Core Technology — Content Stack
-------------------------------------------------------------- */

.technology-core__items {
	min-width: 0;
	display: flex;
	flex-direction: column;
}

.technology-core__item {
	position: relative;
	display: grid;
	grid-template-columns: clamp(6rem, 8vw, 8rem) minmax(0, 1fr);
	min-height: 20rem;
	padding: clamp(2.75rem, 4vw, 4rem);
	background: var(--eulai-color-surface);
	border: 1px solid var(--eulai-color-border);
	border-radius: 0.5rem;
	box-shadow: 0 0.75rem 2.5rem rgba(23, 25, 28, 0.06);
}


@media (min-width: 768px) {

	/*
	 * Scroll runway.
	 *
	 * This element owns the complete scroll timeline.
	 * The sticky stage remains fixed while the cards
	 * move and scale inside it.
	 */
	.technology-core__items {
		position: relative;
	}

	.technology-core__runway {
		position: relative;
		min-height: calc(
			var(--technology-stage-height)
			+ var(--technology-scroll-distance)
		);
	}


	/*
	 * Single sticky stage.
	 *
	 * Only the stage is sticky.
	 * Individual cards no longer participate in
	 * browser sticky positioning.
	 */
	.technology-core__stage {
		position: sticky;
		top: var(--technology-stack-top);
		height: var(--technology-stage-height);
		overflow: visible;
	}


	/*
	 * Cards share the same stage.
	 *
	 * JS controls:
	 * --technology-card-y
	 * --technology-card-scale
	 */
	.technology-core__item {
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;

		min-height: 26rem;

		margin: 0;

		transform:
			translate3d(
				0,
				var(--technology-card-y, 0px),
				0
			)
			scale(
				var(--technology-card-scale, 1)
			);

		transform-origin: center top;

		will-change: transform;
		backface-visibility: hidden;
	}


	.technology-core__item:nth-child(1) {
		z-index: 1;
	}

	.technology-core__item:nth-child(2) {
		z-index: 2;
	}

	.technology-core__item:nth-child(3) {
		z-index: 3;
	}

}


/* --------------------------------------------------------------
   Core Technology — Number
-------------------------------------------------------------- */

.technology-core__number {
	display: inline-block;
	width: fit-content;

	padding-right: clamp(1.5rem, 2.5vw, 2.5rem);

	font-size: clamp(3.75rem, 5vw, 5rem);
	font-weight: 700;
	line-height: 1;
	letter-spacing: -0.04em;

	background: var(--eulai-gradient-brand);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
}


/* --------------------------------------------------------------
   Core Technology — Body
-------------------------------------------------------------- */

.technology-core__body {
	min-width: 0;
	padding-left: clamp(2rem, 3vw, 3rem);
	border-left: 1px solid var(--eulai-color-border);
}

.technology-core__item-title {
	margin: 0 0 1.75rem;
	font-size: clamp(1.5rem, 2vw, 1.875rem);
	font-weight: 600;
	line-height: 1.35;
	color: var(--eulai-color-text-primary);
}

.technology-core__item-content {
	font-size: 1rem;
	line-height: 1.9;
	color: var(--eulai-color-text-secondary);
}

.technology-core__item-content p {
	margin: 0;
}

.technology-core__item-content p + p {
	margin-top: 0.75rem;
}


/* --------------------------------------------------------------
   Core Technology — Entrance Motion
-------------------------------------------------------------- */

.technology-core__title,
.technology-core__intro,
.technology-core__items {
	opacity: 0;

	transition:
		opacity 1.25s cubic-bezier(0.22, 1, 0.36, 1),
		transform 1.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.technology-core__title {
	transform: translate3d(0, -2rem, 0);
}

.technology-core__intro {
	transform: translate3d(-2rem, 0, 0);
}

.technology-core__items {
	transform: translate3d(3rem, 0, 0);
}

.technology-core.is-visible .technology-core__title,
.technology-core.is-visible .technology-core__intro,
.technology-core.is-visible .technology-core__items {
	opacity: 1;
	transform: translate3d(0, 0, 0);
}

/* --------------------------------------------------------------
   Software Platform
-------------------------------------------------------------- */

.technology-software__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(1.5rem, 2.5vw, 2.5rem);
}

.technology-software__item {
	min-width: 0;
	overflow: hidden;

	background: var(--eulai-color-surface);
	border: 1px solid var(--eulai-color-border);
	border-radius: 0.5rem;
}

.technology-software__media {
	display: flex;
	align-items: center;
	justify-content: center;

	aspect-ratio: 16 / 9;
	overflow: hidden;

	background: var(--eulai-color-surface);
}

.technology-software__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.technology-software__item-title {
	margin: 0;
	padding: 1.25rem 1.5rem;

	border-top: 1px solid var(--eulai-color-border);

	font-size: 1.125rem;
	font-weight: 600;
	line-height: 1.4;

	color: var(--eulai-color-text-primary);
}


/* --------------------------------------------------------------
   Software Platform — Entrance Motion
-------------------------------------------------------------- */

.technology-software__header,
.technology-software__item {
	opacity: 0;

	transition:
		opacity 1.25s cubic-bezier(0.22, 1, 0.36, 1),
		transform 1.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.technology-software__header {
	transform: translate3d(0, -2rem, 0);
}

.technology-software__item {
	transform: translate3d(0, 3rem, 0);
}

.technology-software__header.is-visible,
.technology-software__item.is-visible {
	opacity: 1;
	transform: translate3d(0, 0, 0);
}


/* --------------------------------------------------------------
   Tablet
-------------------------------------------------------------- */

@media (max-width: 999px) {

	.technology-core__layout {
		grid-template-columns: minmax(0, 0.64fr) minmax(0, 1.36fr);
		gap: clamp(2.5rem, 4vw, 3.5rem);
	}

	.technology-core__item {
		grid-template-columns: 5rem minmax(0, 1fr);
		padding: 2.5rem;
	}

	.technology-core__number {
		font-size: 3.5rem;
		padding-right: 1.5rem;
	}

	.technology-core__body {
		padding-left: 2rem;
	}

	.technology-software__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

}


/* --------------------------------------------------------------
   Mobile
-------------------------------------------------------------- */

@media (max-width: 767px) {

	.technology-core__layout {
		display: block;
	}

	.technology-core__header {
		position: static;
		margin-bottom: 3rem;
	}

	.technology-core__header-inner {
		position: static;
		height: auto;
	}

	.technology-core__items {
		min-height: 0;
	}

	.technology-core__stage {
		position: static;
		height: auto;
		overflow: visible;
	}

	.technology-core__item {
		position: relative;
		top: auto;
		left: auto;

		display: block;
		width: auto;
		min-height: 0;
		padding: 2rem;

		transform: none;
		will-change: auto;
	}

	.technology-core__item + .technology-core__item {
		margin-top: 1rem;
	}

	.technology-core__number {
		margin-bottom: 1.5rem;
		padding-right: 0;
		font-size: 3rem;
	}

	.technology-core__body {
		padding-left: 0;
		border-left: 0;
	}

	.technology-core__item-title {
		margin-bottom: 1.25rem;
	}

	.technology-software__grid {
		grid-template-columns: 1fr;
		gap: 1.25rem;
	}

	.technology-software__item-title {
		padding: 1rem 1.25rem;
		font-size: 1.0625rem;
	}

}


@media (prefers-reduced-motion: reduce) {

	.technology-core__title,
	.technology-core__intro,
	.technology-core__items,
	.technology-software__header,
	.technology-software__item {
		opacity: 1;
		transform: none;
		transition: none;
	}

}