/*
 * ExportForge Phase B3: bounded motion and semantic interaction.
 * Product meaning determines feedback; content remains available without JS.
 */
/* stylelint-disable no-descending-specificity -- semantic ledger order */

:root {
	--ef-motion-fast-interaction: 140ms;
	--ef-motion-standard-interaction: 200ms;
	--ef-motion-deliberate-reveal: 320ms;
	--ef-motion-ease-precise: cubic-bezier(0.23, 1, 0.32, 1);
	--ef-motion-directional-distance: 0.25rem;
	--ef-motion-reveal-distance: 0.75rem;
}

/* Selected scenes use the existing one-shot observer. */
.ef-premium-js [data-ef-reveal] {
	opacity: 0;
	transform: translateY(var(--ef-motion-reveal-distance));
	transition:
		opacity var(--ef-motion-deliberate-reveal) var(--ef-motion-ease-precise),
		transform var(--ef-motion-deliberate-reveal) var(--ef-motion-ease-precise);
}

.ef-premium-js [data-ef-reveal].is-visible {
	opacity: 1;
	transform: none;
}

/* Hero motion is one restrained page-entry sequence, never an intro screen. */
@media (prefers-reduced-motion: no-preference) {

	.ef-commercial-hero__content > :where(h1, p, .ef-button) {
		animation: ef-b3-hero-copy-in var(--ef-motion-deliberate-reveal) var(--ef-motion-ease-precise) both;
	}

	.ef-commercial-hero__content > p {
		animation-delay: 60ms;
	}

	.ef-commercial-hero__content > .ef-button {
		animation-delay: 110ms;
	}

	.ef-commercial-hero > img {
		animation: ef-b3-hero-media-in 420ms var(--ef-motion-ease-precise) 80ms both;
	}
}

@keyframes ef-b3-hero-copy-in {

	from {
		opacity: 0;
		transform: translateY(0.625rem);
	}
}

@keyframes ef-b3-hero-media-in {

	from {
		opacity: 0;
		clip-path: inset(0 0 10% 0);
	}
}

/* Buttons communicate actuation. */

/* Navigation communicates direction and current state. */
.ef-button,
.site-header__cta,
.ef-product-rail__control {
	transition:
		color var(--ef-motion-fast-interaction) var(--ef-motion-ease-precise),
		background-color var(--ef-motion-fast-interaction) var(--ef-motion-ease-precise),
		border-color var(--ef-motion-fast-interaction) var(--ef-motion-ease-precise),
		transform var(--ef-motion-fast-interaction) var(--ef-motion-ease-precise);
}

.ef-button:active,
.site-header__cta:active,
.ef-product-rail__control:active {
	transform: scale(0.97);
}

/* Product: inspect the object, without lifting the whole card. */
:where(.ef-product-card, .ef-product-spotlight-dossier article, .ef-product-rail__card) {
	transform: none;
	box-shadow: none;
}

:where(.ef-product-card, .ef-product-spotlight-dossier article, .ef-product-rail__card):hover,
:where(.ef-product-card, .ef-product-spotlight-dossier article, .ef-product-rail__card):focus-within {
	transform: none;
}

.site-main .ef-product-card:hover,
.site-main .ef-product-card:focus-within {
	transform: none;
	box-shadow: none;
}

.site-main .ef-product-card:focus-within .ef-product-card__media img {
	transform: none;
}

:where(
.ef-product-card__media,
.ef-product-spotlight-dossier article,
.ef-product-rail__card
) img {
	transition:
		transform var(--ef-motion-standard-interaction) var(--ef-motion-ease-precise),
		filter var(--ef-motion-standard-interaction) var(--ef-motion-ease-precise);
}

:where(.ef-product-card, .ef-product-spotlight-dossier article, .ef-product-rail__card):focus-within {
	outline: var(--ef-focus-ring-width) solid var(--ef-color-focus);
	outline-offset: var(--ef-focus-ring-offset);
}

/* Category: reveal hierarchy direction through a progressing rule. */
.ef-category-browser a {
	background-image: linear-gradient(currentcolor, currentcolor);
	background-position: 0 100%;
	background-repeat: no-repeat;
	background-size: 0 1px;
	transition:
		color var(--ef-motion-fast-interaction) var(--ef-motion-ease-precise),
		background-size var(--ef-motion-standard-interaction) var(--ef-motion-ease-precise),
		padding-inline-start var(--ef-motion-standard-interaction) var(--ef-motion-ease-precise);
}

.ef-category-browser a:is(:hover, :focus-visible) {
	color: var(--ef-color-primary);
	background-size: 100% 1px;
	padding-inline-start: var(--ef-motion-directional-distance);
}

.ef-category-browser__count {
	transition: color var(--ef-motion-fast-interaction) var(--ef-motion-ease-precise);
}

/* Manufacturing: capability lines and technical specifications, not cards. */
.ef-manufacturing-capability-split__items > article,
.ef-equipment-dossier__items > article {
	transition:
		border-color var(--ef-motion-standard-interaction) var(--ef-motion-ease-precise),
		background-color var(--ef-motion-standard-interaction) var(--ef-motion-ease-precise);
}

.ef-equipment-dossier__items > article img {
	transition:
		transform var(--ef-motion-standard-interaction) var(--ef-motion-ease-precise),
		filter var(--ef-motion-standard-interaction) var(--ef-motion-ease-precise);
}

.ef-equipment-dossier__items dl > div {
	transition:
		border-color var(--ef-motion-fast-interaction) var(--ef-motion-ease-precise),
		background-color var(--ef-motion-fast-interaction) var(--ef-motion-ease-precise);
}

.ef-equipment-dossier__items dl > div:is(:hover, :focus-within) {
	border-color: var(--ef-color-primary);
	background: color-mix(in srgb, var(--ef-color-primary) 5%, transparent);
}

/* Process: active ordered state follows the viewport-aware controller. */
:where(.ef-process-step, .ef-process-timeline__step) {
	transition:
		border-color var(--ef-motion-standard-interaction) var(--ef-motion-ease-precise),
		background-color var(--ef-motion-standard-interaction) var(--ef-motion-ease-precise);
}

:where(.ef-process-step, .ef-process-timeline__step).is-active,
:where(.ef-process-step, .ef-process-timeline__step)[aria-current="step"] {
	border-color: var(--ef-color-primary);
	background: color-mix(in srgb, var(--ef-color-primary) 5%, var(--ef-color-surface));
}

/* Factory: inspect media through crop emphasis; captions remain available. */
:where(.ef-factory-media, .ef-factory-gallery__items figure) {
	transform: none;
	box-shadow: none;
}

:where(.ef-factory-media, .ef-factory-gallery__items figure) img {
	transition:
		transform var(--ef-motion-standard-interaction) var(--ef-motion-ease-precise),
		filter var(--ef-motion-standard-interaction) var(--ef-motion-ease-precise);
}

:where(.ef-factory-media, .ef-factory-gallery__items figure) a:focus-visible {
	display: block;
	outline: var(--ef-focus-ring-width) solid var(--ef-color-focus);
	outline-offset: var(--ef-focus-ring-offset);
}

.site-main .ef-factory-media:focus-within .ef-factory-media__image,
.site-main .ef-factory-gallery__items figure:focus-within img {
	transform: none;
}

/* Quality uses a procedural spine, distinct from process active cards. */
.ef-quality-inspection-workflow ol > li,
.ef-quality-workflow .ef-public-knowledge-group {
	border-inline-start-color: var(--ef-color-border);
	transition:
		border-color var(--ef-motion-standard-interaction) var(--ef-motion-ease-precise),
		background-color var(--ef-motion-standard-interaction) var(--ef-motion-ease-precise);
}

.ef-quality-inspection-workflow ol > li:is(:hover, :focus-within),
.ef-quality-workflow .ef-public-knowledge-group:is(:hover, :focus-within) {
	border-inline-start-color: var(--ef-color-primary);
	background: color-mix(in srgb, var(--ef-color-primary) 4%, var(--ef-color-surface));
}

/* Evidence: factual rows remain spatially stable; only proof state changes. */
.ef-traceable-evidence-matrix__items > article,
.ef-public-knowledge__fact {
	transform: none;
	transition:
		border-color var(--ef-motion-fast-interaction) var(--ef-motion-ease-precise),
		background-color var(--ef-motion-fast-interaction) var(--ef-motion-ease-precise);
}

.ef-traceable-evidence-matrix__items > article:is(:hover, :focus-within),
.ef-public-knowledge__fact:is(:hover, :focus-within) {
	border-color: var(--ef-color-primary);
	background: color-mix(in srgb, var(--ef-color-primary) 3%, var(--ef-color-surface));
}

.ef-traceable-evidence-matrix a {
	text-underline-offset: 0.25em;
	text-decoration-thickness: 1px;
}

/* Metrics: reveal labels and rules; never bounce or count for spectacle. */
.ef-manufacturing-metric-rail__items > div {
	transition:
		border-color var(--ef-motion-fast-interaction) var(--ef-motion-ease-precise),
		background-color var(--ef-motion-fast-interaction) var(--ef-motion-ease-precise);
}

.ef-manufacturing-metric-rail__items > div:is(:hover, :focus-within) {
	border-color: var(--ef-color-primary);
	background: color-mix(in srgb, var(--ef-color-primary) 4%, transparent);
}

/* Applications: directional relationship, not a lifted content card. */
.ef-application-index__item,
.ef-application-product-matrix__products > li {
	transform: none;
	transition:
		background-color var(--ef-motion-standard-interaction) var(--ef-motion-ease-precise),
		border-color var(--ef-motion-standard-interaction) var(--ef-motion-ease-precise);
}

.ef-application-index__arrow {
	transition: transform var(--ef-motion-standard-interaction) var(--ef-motion-ease-precise);
}

.ef-application-product-matrix__products a {
	background-image: linear-gradient(currentcolor, currentcolor);
	background-position: 0 100%;
	background-repeat: no-repeat;
	background-size: 0 1px;
	transition:
		color var(--ef-motion-fast-interaction) var(--ef-motion-ease-precise),
		background-size var(--ef-motion-standard-interaction) var(--ef-motion-ease-precise);
}

.ef-application-product-matrix__products a:is(:hover, :focus-visible) {
	color: var(--ef-color-primary);
	background-size: 100% 1px;
}

/* Resources use editorial reading cues, not product motion. */
.ef-resource-page .ef-editorial-page__content a {
	text-decoration-color: color-mix(in srgb, currentcolor 35%, transparent);
	text-underline-offset: 0.28em;
	transition:
		color var(--ef-motion-fast-interaction) var(--ef-motion-ease-precise),
		text-decoration-color var(--ef-motion-fast-interaction) var(--ef-motion-ease-precise),
		text-underline-offset var(--ef-motion-fast-interaction) var(--ef-motion-ease-precise);
}

.ef-resource-page .ef-editorial-page__content a:is(:hover, :focus-visible) {
	color: var(--ef-color-primary);
	text-decoration-color: currentcolor;
	text-underline-offset: 0.4em;
}

/* RFQ: conversion state is deliberate and finite. */
.ef-contextual-rfq,
.ef-contact-rfq__inquiry-panel {
	transition:
		border-color var(--ef-motion-standard-interaction) var(--ef-motion-ease-precise),
		background-color var(--ef-motion-standard-interaction) var(--ef-motion-ease-precise);
}

.ef-inquiry-form :where(input, select, textarea) {
	transition:
		border-color var(--ef-motion-fast-interaction) var(--ef-motion-ease-precise),
		box-shadow var(--ef-motion-fast-interaction) var(--ef-motion-ease-precise),
		background-color var(--ef-motion-fast-interaction) var(--ef-motion-ease-precise);
}

@media (hover: hover) and (pointer: fine) {

	:where(.ef-product-card, .ef-product-spotlight-dossier article, .ef-product-rail__card):hover img {
		transform: scale(1.025);
		filter: saturate(0.88) contrast(1.04);
	}

	.site-main .ef-product-card:hover .ef-product-card__media img {
		transform: scale(1.025);
	}

	.ef-equipment-dossier__items > article:hover {
		border-color: var(--ef-color-primary);
		background: color-mix(in srgb, var(--ef-color-primary) 3%, var(--ef-color-surface));
	}

	.ef-equipment-dossier__items > article:hover img {
		transform: scale(1.015);
	}

	.ef-manufacturing-capability-split__items > article:hover {
		border-color: var(--ef-color-primary);
	}

	:where(.ef-factory-media, .ef-factory-gallery__items figure):hover img {
		transform: scale(1.02);
		filter: saturate(0.9) contrast(1.04);
	}

	.site-main .ef-factory-media:hover .ef-factory-media__image,
	.site-main .ef-factory-gallery__items figure:hover img {
		transform: scale(1.02);
	}

	.ef-application-index__item:hover {
		background: color-mix(in srgb, var(--ef-color-primary) 4%, var(--ef-color-surface));
		transform: none;
	}

	.ef-application-index__item:first-child:hover {
		background: var(--ef-commercial-industrial-soft);
	}

	.ef-application-index__item:hover .ef-application-index__arrow {
		transform: translateX(var(--ef-motion-directional-distance));
	}

	.ef-application-index__item:hover img {
		transform: scale(1.015);
	}
}

.ef-application-index__item:first-child:focus-within {
	background: var(--ef-commercial-industrial-soft);
}

.ef-application-index__item:focus-within,
.ef-application-index__item:focus-within img,
.ef-application-index__item:focus-within .ef-application-index__arrow {
	transform: none;
}

@media (max-width: 47.99rem), (hover: none), (pointer: coarse) {

	.ef-category-browser a:is(:hover, :focus-visible) {
		padding-inline-start: 0;
	}

	:where(
	.ef-product-card,
	.ef-product-spotlight-dossier article,
	.ef-product-rail__card,
	.ef-equipment-dossier__items > article,
	.ef-factory-media,
	.ef-factory-gallery__items figure
) img {
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {

	.ef-commercial-hero__content > *,
	.ef-commercial-hero > img {
		animation: none;
	}

	.ef-premium-js [data-ef-reveal],
	.ef-premium-js [data-ef-reveal].is-visible {
		opacity: 1;
		transform: none;
		transition: none;
	}

	:where(
	.ef-button,
	.site-header__cta,
	.ef-product-rail__control,
	.ef-category-browser a,
	.ef-product-card img,
	.ef-product-spotlight-dossier img,
	.ef-product-rail__card img,
	.ef-equipment-dossier img,
	.ef-process-step,
	.ef-process-timeline__step,
	.ef-factory-media img,
	.ef-factory-gallery__items img,
	.ef-quality-inspection-workflow li,
	.ef-traceable-evidence-matrix__items > article,
	.ef-manufacturing-metric-rail__items > div,
	.ef-application-index__item,
	.ef-application-index__arrow,
	.ef-application-product-matrix__products a,
	.ef-resource-page a,
	.ef-contextual-rfq,
	.ef-inquiry-form input,
	.ef-inquiry-form select,
	.ef-inquiry-form textarea
) {
		transition-duration: var(--ef-semantic-motion-reduced-duration, 0ms);
	}

	:where(
	.ef-button,
	.site-header__cta,
	.ef-product-rail__control,
	.ef-product-card img,
	.ef-product-spotlight-dossier img,
	.ef-product-rail__card img,
	.ef-equipment-dossier img,
	.ef-factory-media img,
	.ef-factory-gallery__items img,
	.ef-application-index__arrow
) {
		transform: none;
	}
}
