/* ==========================================================================
   Atuty — Figma 1:125: granatowy pasek, 4 kolumny, ikona w pomarańczowym kole
   Kolory tekstu dopasowują się do tła (seed: background = dark jak w Figmie).
   ========================================================================== */
.section--features {
	--features-title: var(--color-navy);
	--features-text: var(--color-text-muted);
	padding-block: clamp(3.5rem, 6vw, 5rem);
}

.section--features.section--bg-dark {
	--features-title: #fff;
	--features-text: var(--color-text-subtle);
}

.features__list {
	display: grid;
	gap: 2.5rem 1.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.features__item {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.features__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	margin-bottom: 1.5rem;
	border-radius: 50%;
	background: var(--color-accent);
	box-shadow: 0 10px 15px -3px rgba(124, 45, 18, 0.2), 0 4px 6px -4px rgba(124, 45, 18, 0.2);
}

.features__icon-img {
	width: auto;
	max-width: 32px;
	height: 24px;
	object-fit: contain;
}

.features__title {
	margin: 0 0 0.5rem;
	font-family: var(--font-base);
	font-size: 1.125rem;
	font-weight: 700;
	line-height: 1.555;
	letter-spacing: 0;
	color: var(--features-title);
}

.features__text {
	max-width: 280px;
	margin: 0;
	font-size: 0.875rem;
	line-height: 1.43;
	color: var(--features-text);
}

@media (min-width: 640px) {
	.features__list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	.features__list {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 3rem;
	}
}

/* ==========================================================================
   Wariant z nagłówkiem („Pokaż nagłówek”) — Figma 107:348 „Nasze Wartości”:
   sekcja 120 px w pionie, H2 36/54 bez wielkich liter + belka 64×4, 64 px do atutów,
   atuty w jednym rzędzie (dowolna liczba), tytuł 20/30, opis 16/24.
   ========================================================================== */
.section--features:has(.features--titled) {
	padding-block: clamp(4rem, 8.5vw, 7.5rem);
}

.features--titled .features__head {
	margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.features--titled .section-head__heading {
	line-height: 1.5;
	text-transform: none;
}

.features--titled .section-head__bar {
	width: 64px;
	height: 4px;
}

/* Flex zamiast siatki: niepełny rząd (np. 3 atuty na tablecie) wyśrodkowany, bez „sieroty” przy lewej. */
.features--titled .features__list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 2.5rem 3rem;
}

.features--titled .features__item {
	flex: 1 1 0;
	min-width: min(100%, 260px);
}

.features--titled .features__title {
	margin-bottom: 0.75rem;
	font-size: var(--fs-h3);
	line-height: 1.5;
}

.features--titled .features__text {
	max-width: 380px;
	font-size: 1rem;
	line-height: 1.5;
}

.section--features:not(.section--bg-dark) .features--titled .features__text {
	color: var(--color-text-body);
}

@media (min-width: 1024px) {
	.features--titled .features__list {
		flex-wrap: nowrap;
	}
}

/* ==========================================================================
   Animacja wejścia: atuty kaskadowo (110 ms, features.php) — ikona „pop” z lekkim
   odbiciem i jednorazową poświatą, potem tytuł i opis fade-up z blur.
   ========================================================================== */
/* Poświata: jednorazowy pierścień (pseudo-element, animowane tylko transform/opacity). */
@keyframes optitek-features-glow {
	from {
		opacity: 0.5;
		transform: scale(1);
	}

	to {
		opacity: 0;
		transform: scale(1.7);
	}
}

.has-reveal .features__icon[data-reveal] {
	position: relative;
	isolation: isolate; /* pierścień (z-index: -1) zostaje nad tłem sekcji, pod ikoną */
}

.has-reveal .features__icon[data-reveal]::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	border-radius: 50%;
	background: var(--color-accent);
	opacity: 0;
	pointer-events: none;
}

.has-reveal .features__icon[data-reveal="pop"] {
	--reveal-duration: 0.7s;
}

.has-reveal .features__icon[data-reveal].is-revealed::after {
	animation: optitek-features-glow 1.2s var(--ease-soft) calc(var(--reveal-delay, 0ms) + 250ms);
}

.has-reveal .features__item [data-reveal="fade-up"] {
	--reveal-distance: 32px;
}

@media (prefers-reduced-motion: reduce) {
	.has-reveal .features__icon[data-reveal].is-revealed::after {
		animation: none;
	}
}
