/* =============================================================
   Elite Pearl Charter — "Why Choose Us?"

   Centred intro, then four cards.
   Grid: 1 col -> 2 (560px) -> 4 (1200px).
   ============================================================= */

.epc-why {
	background: var(--epc-black);
	color: var(--epc-silver);
	border-top: 1px solid var(--epc-line-soft);
}

.epc-why__inner {
	width: 100%;
	max-width: var(--epc-container);
	margin-inline: auto;
	padding: 4rem var(--epc-gutter);
}

@media (min-width: 768px) {
	.epc-why__inner {
		padding-block: 5.5rem;
	}
}

@media (min-width: 1200px) {
	.epc-why__inner {
		padding-block: 7rem;
	}
}

/* --- Intro ------------------------------------------------------- */

.epc-why__intro {
	max-width: 62rem;
	margin: 0 auto 3rem;
	text-align: center;
}

@media (min-width: 768px) {
	.epc-why__intro {
		margin-bottom: 4rem;
	}
}

.epc-why__heading {
	margin: 0;
	font-family: var(--epc-font-serif);
	font-size: clamp(1.625rem, 4.6vw, 2.75rem);
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: 0.01em;
	text-transform: uppercase;
}

.epc-why__rule {
	display: block;
	width: 72px;
	height: 1px;
	margin: 1.25rem auto 1.5rem;
	background: linear-gradient(
		to right,
		transparent 0%,
		rgb(255 255 255 / 70%) 50%,
		transparent 100%
	);
}

.epc-why__text {
	max-width: 70ch;
	margin: 0 auto;
	font-family: var(--epc-font-sans);
	font-size: clamp(0.875rem, 2vw, 1rem);
	line-height: 1.9;
	color: var(--epc-grey);
	text-wrap: pretty;
}

/* --- Grid --------------------------------------------------------- */

.epc-why__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 560px) {
	.epc-why__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 1.25rem;
	}
}

@media (min-width: 1200px) {
	.epc-why__grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 1.5rem;
	}
}

/* --- Card ---------------------------------------------------------- */

.epc-why__item {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	overflow: hidden;
	padding: 2rem 1.5rem 1.75rem;
	background: var(--epc-gradient-surface);
	border: 1px solid rgb(141 143 142 / 35%);
	border-radius: 14px;
	box-shadow:
		0 0 0 rgb(0 0 0 / 0%),
		inset 0 1px 0 rgb(255 255 255 / 6%);
	transition: transform 520ms var(--epc-ease-soft),
		border-color 520ms var(--epc-ease-soft),
		box-shadow 520ms var(--epc-ease-soft);
}

@media (min-width: 1200px) {
	.epc-why__item {
		padding: 2.25rem 1.5rem 2rem;
	}
}

.epc-why__item:hover,
.epc-why__item:focus-within {
	transform: translateY(-4px);
	border-color: rgb(255 255 255 / 55%);
	box-shadow:
		0 18px 38px rgb(0 0 0 / 45%),
		inset 0 1px 0 rgb(255 255 255 / 12%);
}

/* Gradient hairline along the top edge, wiping in from the left on hover. */
.epc-why__accent {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 2px;
	background: var(--epc-gradient-title);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 620ms var(--epc-ease-soft);
}

.epc-why__item:hover .epc-why__accent,
.epc-why__item:focus-within .epc-why__accent {
	transform: scaleX(1);
}

/* --- Ghost index --------------------------------------------------- */

.epc-why__index {
	position: absolute;
	top: 0.85rem;
	right: 1.1rem;
	font-family: var(--epc-font-serif);
	font-size: 2.75rem;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.02em;
	color: transparent;
	-webkit-text-stroke: 1px rgb(255 255 255 / 16%);
	transition: opacity 520ms var(--epc-ease-soft);
}

@media (min-width: 1200px) {
	.epc-why__index {
		font-size: 3.25rem;
	}
}

.epc-why__item:hover .epc-why__index {
	opacity: 0.55;
}

/* --- Icon ----------------------------------------------------------- */

.epc-why__icon {
	position: relative;
	display: grid;
	place-items: center;
	width: 58px;
	height: 58px;
	margin-bottom: 1.35rem;
	font-size: 1.375rem;
	color: var(--epc-white);
	background: var(--epc-ink-950);
	border: 1px solid var(--epc-line);
	border-radius: 50%;
	transition: color 520ms var(--epc-ease-soft),
		border-color 520ms var(--epc-ease-soft);
}

/*
 * The gradient fill sits on its own layer whose opacity animates. A gradient is
 * a background-image and background-image cannot be transitioned, so setting it
 * directly on :hover would snap in one frame.
 */
.epc-why__icon::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: var(--epc-gradient-title);
	opacity: 0;
	transition: opacity 520ms var(--epc-ease-soft);
}

.epc-why__icon i {
	position: relative;
	z-index: 1;
}

.epc-why__item:hover .epc-why__icon,
.epc-why__item:focus-within .epc-why__icon {
	color: var(--epc-black);
	border-color: transparent;
}

.epc-why__item:hover .epc-why__icon::before,
.epc-why__item:focus-within .epc-why__icon::before {
	opacity: 1;
}

/* --- Text ------------------------------------------------------------ */

.epc-why__label {
	margin: 0;
	font-family: var(--epc-font-serif);
	font-size: clamp(1.0625rem, 2.2vw, 1.1875rem);
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--epc-white);
	text-wrap: balance;
}

.epc-why__divider {
	display: block;
	width: 34px;
	height: 1px;
	margin: 0.9rem 0;
	background: linear-gradient(
		to right,
		rgb(255 255 255 / 60%) 0%,
		transparent 100%
	);
	transition: width 520ms var(--epc-ease-soft);
}

.epc-why__item:hover .epc-why__divider,
.epc-why__item:focus-within .epc-why__divider {
	width: 58px;
}

.epc-why__copy {
	margin: 0;
	font-family: var(--epc-font-sans);
	font-size: clamp(0.8125rem, 1.8vw, 0.875rem);
	line-height: 1.75;
	color: var(--epc-grey);
	text-wrap: pretty;
}

/* --- Reduced motion --------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.epc-why__item,
	.epc-why__icon,
	.epc-why__icon::before,
	.epc-why__accent,
	.epc-why__divider,
	.epc-why__index {
		transition-duration: 0.01ms !important;
	}

	.epc-why__item:hover,
	.epc-why__item:focus-within {
		transform: none;
	}
}
