/*
 * Reusable pieces. One block per component, named after the template part
 * that renders it, so markup and styles stay findable from each other.
 */

/* ---------------------------------------------------------------- buttons */
.am-btn {
	display: inline-flex;
	align-items: center;
	gap: var(--am-space-2);
	padding: 12px 22px;
	border: 1px solid var(--am-green-dark);
	border-radius: var(--am-radius-sm);
	background: var(--am-green-dark);
	color: var(--am-on-dark);
	font-size: var(--am-text-sm);
	font-weight: 600;
	letter-spacing: 0.02em;
	text-decoration: none;
	cursor: pointer;
	transition: background var(--am-fast) var(--am-ease), color var(--am-fast) var(--am-ease);
}

.am-btn:hover,
.am-btn:focus-visible {
	background: var(--am-green-darker);
	border-color: var(--am-green-darker);
	color: var(--am-on-dark);
	text-decoration: none;
}

.am-btn-ghost {
	background: transparent;
	border-color: currentcolor;
	color: var(--am-green-dark);
}

.am-btn-ghost:hover {
	background: var(--am-green-soft);
	border-color: var(--am-green-dark);
	color: var(--am-green-darker);
}

.am-btn-on-dark {
	border-color: var(--am-surface);
	background: var(--am-surface);
	color: var(--am-green-dark);
}

.am-btn-on-dark:hover {
	background: #f4fff6;
	border-color: #f4fff6;
	color: var(--am-green-darker);
}

.am-btn-on-dark-ghost {
	background: transparent;
	border-color: var(--am-surface);
	color: var(--am-on-dark);
}

.am-btn-on-dark-ghost:hover {
	background: rgba(255, 255, 255, 0.14);
	border-color: var(--am-surface);
	color: var(--am-on-dark);
}

.am-btn-row {
	display: flex;
	flex-wrap: wrap;
	gap: var(--am-space-3);
}

/* ------------------------------------------------------------------ badges */
.am-badge {
	display: inline-block;
	margin-bottom: var(--am-space-3);
	padding: 4px 10px;
	border-radius: var(--am-radius-pill);
	background: var(--am-green-soft);
	color: var(--am-green-dark);
	font-size: var(--am-text-xs);
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.am-chip {
	display: inline-block;
	padding: 3px 9px;
	border-radius: var(--am-radius-pill);
	background: var(--am-surface-soft);
	color: var(--am-muted);
	font-size: var(--am-text-xs);
}

/* -------------------------------------------------------------- page heroes */
.am-hero {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 340px;
	padding: calc(var(--am-header-height) + var(--am-space-7)) var(--am-gutter) var(--am-space-7);
	background: var(--am-surface-dark);
	background-position: center;
	background-size: cover;
	color: var(--am-on-dark);
	text-align: center;
}

.am-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(12, 22, 16, 0.45);
}

/* A missing page. Taller than the usual band so the closed gate stays in frame. */
.am-hero.am-hero-lost {
	min-height: 520px;
	background-position: center 42%;
}

.am-hero.am-hero-lost::before {
	background: linear-gradient(180deg, rgba(8, 18, 12, 0.48) 0%, rgba(8, 18, 12, 0.16) 46%, rgba(8, 18, 12, 0.3) 100%);
}

.am-hero-body {
	position: relative;
	z-index: 2;
	max-width: 820px;
}

.am-hero-title {
	margin: 0;
	color: var(--am-on-dark);
	text-shadow: 0 2px 16px rgba(0, 0, 0, 0.45);
}

.am-hero-lead {
	margin: var(--am-space-4) 0 0;
	color: rgba(255, 255, 255, 0.92);
	font-size: var(--am-text-lg);
}

/* Video hero on the home page */
.am-hero-video {
	position: relative;
	display: flex;
	align-items: center;
	min-height: 100vh;
	padding: calc(var(--am-header-height) + var(--am-space-7)) 0 var(--am-space-9);
	overflow: hidden;
	background: var(--am-surface-dark);
	color: var(--am-on-dark);
	text-align: left;
}

.am-hero-video video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.am-hero-video::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, rgba(10, 48, 24, 0.7) 0%, rgba(14, 56, 28, 0.4) 55%, rgba(18, 64, 32, 0.16) 100%);
}

.am-hero-video .am-container {
	position: relative;
	z-index: 2;
}

.am-hero-video .am-hero-body {
	max-width: 620px;
}

.am-hero-video .am-hero-title {
	margin-bottom: var(--am-space-4);
}

.am-hero-scroll {
	position: absolute;
	bottom: var(--am-space-6);
	left: 50%;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--am-space-2);
	color: rgba(255, 255, 255, 0.85);
	font-size: var(--am-text-sm);
	transform: translateX(-50%);
}

.am-hero-scroll span.am-hero-scroll-arrow {
	width: 14px;
	height: 14px;
	border-right: 2px solid currentcolor;
	border-bottom: 2px solid currentcolor;
	transform: rotate(45deg);
	animation: am-bob 1.8s var(--am-ease) infinite;
}

@keyframes am-bob {
	0%,
	100% {
		transform: rotate(45deg) translate(0, 0);
	}

	50% {
		transform: rotate(45deg) translate(4px, 4px);
	}
}

@media (max-width: 1024px) {
	.am-hero-video {
		min-height: 78vh;
	}
}

/* --------------------------------------------------------------- tab groups */
.am-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: var(--am-space-2);
	justify-content: center;
	margin-bottom: var(--am-space-6);
	padding: 0;
	list-style: none;
}

.am-tab {
	padding: 9px 18px;
	border: 1px solid var(--am-line);
	border-radius: var(--am-radius-pill);
	background: var(--am-surface);
	color: var(--am-ink-soft);
	font-size: var(--am-text-sm);
	font-weight: 600;
	cursor: pointer;
	transition: background var(--am-fast) var(--am-ease), color var(--am-fast) var(--am-ease), border-color var(--am-fast) var(--am-ease);
}

.am-tab:hover {
	border-color: var(--am-green);
	color: var(--am-green-dark);
	text-decoration: none;
}

.am-tab[aria-selected="true"] {
	border-color: var(--am-green-dark);
	background: var(--am-green-dark);
	color: var(--am-on-dark);
	box-shadow: inset 0 -3px 0 var(--am-yellow);
}

.am-tabpanel[hidden] {
	display: none;
}

/* ------------------------------------------------------------- shared cards */
.am-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--am-line);
	border-radius: var(--am-radius);
	background: var(--am-surface);
	box-shadow: var(--am-shadow-sm);
	color: inherit;
	text-decoration: none;
	transition: transform var(--am-fast) var(--am-ease), box-shadow var(--am-fast) var(--am-ease);
}

a.am-card:hover,
a.am-card:focus-visible {
	transform: translateY(-4px);
	box-shadow: inset 0 3px 0 var(--am-yellow), var(--am-shadow);
	color: inherit;
	text-decoration: none;
}

.am-card-media {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 180px;
	padding: var(--am-space-4);
	background: var(--am-surface-soft);
	overflow: hidden;
}

.am-card-media img {
	max-height: 100%;
	object-fit: contain;
}

.am-card-media-cover {
	padding: 0;
}

.am-card-media-cover img {
	width: 100%;
	height: 100%;
	max-height: none;
	object-fit: cover;
	transition: transform var(--am-slow) var(--am-ease);
}

a.am-card:hover .am-card-media-cover img {
	transform: scale(1.05);
}

.am-card-media-tall {
	height: 250px;
}

.am-card-body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: var(--am-space-2);
	padding: var(--am-space-5);
}

.am-card-title {
	margin: 0;
	font-size: var(--am-text-lg);
	font-weight: 700;
}

.am-card-text {
	margin: 0;
	color: var(--am-muted);
	font-size: var(--am-text-sm);
}

.am-card-code {
	position: absolute;
	top: var(--am-space-3);
	left: var(--am-space-3);
	z-index: 2;
	padding: 3px 9px;
	border-radius: var(--am-radius-sm);
	background: var(--am-green-dark);
	color: var(--am-on-dark);
	font-size: var(--am-text-xs);
	font-weight: 700;
	letter-spacing: 0.04em;
}

.am-card-more {
	margin-top: auto;
	padding-top: var(--am-space-2);
	color: var(--am-green-dark);
	font-size: var(--am-text-sm);
	font-weight: 600;
}

.am-card-more .am-icon {
	transition: transform var(--am-fast) var(--am-ease);
}

a.am-card:hover .am-card-more .am-icon {
	transform: translateX(4px);
}

.am-card-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	color: var(--am-muted);
	font-size: var(--am-text-sm);
	text-align: center;
}

/* Icon-led card, used for service roles */
.am-icon-card {
	display: flex;
	gap: var(--am-space-4);
	align-items: flex-start;
	padding: var(--am-space-5);
	border: 1px solid var(--am-line);
	border-radius: var(--am-radius);
	background: var(--am-surface);
	box-shadow: var(--am-shadow-sm);
	transition: transform var(--am-fast) var(--am-ease), box-shadow var(--am-fast) var(--am-ease);
}

.am-icon-card:hover {
	transform: translateY(-3px);
	box-shadow: var(--am-shadow);
}

.am-icon-card-icon {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: var(--am-radius);
	background: var(--am-green-soft);
	color: var(--am-green-dark);
	font-size: var(--am-text-xl);
}

.am-icon-card-title {
	margin: 0 0 var(--am-space-1);
	font-size: var(--am-text-base);
	font-weight: 700;
}

.am-icon-card-text {
	margin: 0;
	color: var(--am-muted);
	font-size: var(--am-text-sm);
}

/* Specification list on a product */
.am-specs {
	display: grid;
	gap: var(--am-space-2) var(--am-space-4);
	grid-template-columns: repeat(2, minmax(0, 1fr));
	margin: var(--am-space-3) 0 0;
	padding: 0;
	list-style: none;
}

.am-specs li {
	margin: 0;
}

.am-spec-label {
	display: block;
	color: var(--am-muted);
	font-size: var(--am-text-xs);
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.am-spec-value {
	display: block;
	font-size: var(--am-text-sm);
	font-weight: 600;
}

/* --------------------------------------------------------------- marquees */
.am-marquee {
	position: relative;
	overflow: hidden;
	mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.am-marquee-track {
	display: flex;
	gap: var(--am-space-7);
	width: max-content;
	align-items: center;
	animation: am-scroll var(--am-marquee-duration, 45s) linear infinite;
}

.am-marquee:hover .am-marquee-track {
	animation-play-state: paused;
}

@keyframes am-scroll {
	from {
		transform: translateX(0);
	}

	to {
		transform: translateX(-50%);
	}
}

@media (prefers-reduced-motion: reduce) {
	.am-marquee-track {
		animation: none;
		flex-wrap: wrap;
		width: auto;
		justify-content: center;
	}

	.am-marquee {
		mask-image: none;
	}
}

.am-logo-item {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 200px;
	height: 88px;
}

#clients .am-marquee {
	margin-top: var(--am-space-4);
}

#clients .am-marquee-track {
	gap: 88px;
}

.am-logo-item img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	filter: grayscale(1);
	opacity: 0.75;
	transition: filter var(--am-fast) var(--am-ease), opacity var(--am-fast) var(--am-ease);
}

.am-logo-item:hover img {
	filter: grayscale(0);
	opacity: 1;
}

.am-logo-item-invert img {
	filter: grayscale(1) invert(1);
}

.am-logo-item-name {
	color: var(--am-muted);
	font-size: var(--am-text-sm);
	font-weight: 600;
	text-align: center;
}

/* Award tiles inside a marquee */
.am-award {
	flex: 0 0 auto;
	width: 260px;
}

.am-award img {
	display: block;
	width: 100%;
	height: 180px;
	object-fit: cover;
	border-radius: var(--am-radius);
	box-shadow: var(--am-shadow-sm);
}

.am-award-caption {
	margin: var(--am-space-3) 0 0;
	color: var(--am-muted);
	font-size: var(--am-text-xs);
	text-align: center;
}

/* ------------------------------------------------------------- testimonial */
.am-quote {
	max-width: 760px;
	margin: 0 auto;
	padding: var(--am-space-6);
	border-radius: var(--am-radius-lg);
	background: var(--am-surface);
	box-shadow: var(--am-shadow);
	text-align: center;
}

.am-quote > .am-icon {
	width: 28px;
	height: 28px;
	color: var(--am-green);
}

.am-quote-text {
	margin: var(--am-space-4) 0;
	color: var(--am-ink-soft);
	font-size: var(--am-text-lg);
	line-height: 1.6;
}

.am-quote-name {
	margin: 0;
	font-weight: 700;
}

.am-quote-role {
	margin: 0;
	color: var(--am-muted);
	font-size: var(--am-text-sm);
}

.am-stars {
	color: #f5a623;
	letter-spacing: 2px;
}

/* ---------------------------------------------------------- closing banner */
/*
 * The band above the footer. It sits on a photograph rather than flat green,
 * so the footer below it reads as a separate part of the page.
 */
.am-cta {
	position: relative;
	padding: 120px 0;
	overflow: hidden;
	background: var(--am-surface-dark);
	background-position: center;
	background-size: cover;
	color: var(--am-on-dark);
}

.am-cta::before {
	content: "";
	position: absolute;
	inset: 0;
	background:
		linear-gradient(115deg, rgba(10, 26, 16, 0.94) 0%, rgba(10, 26, 16, 0.72) 48%, rgba(32, 139, 47, 0.55) 100%);
}

/* A soft brand glow in the corner keeps the band from looking like a flat scrim. */
.am-cta::after {
	content: "";
	position: absolute;
	right: -120px;
	bottom: -160px;
	width: 420px;
	height: 420px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(57, 181, 74, 0.5) 0%, rgba(57, 181, 74, 0) 70%);
	pointer-events: none;
}

.am-cta .am-container {
	position: relative;
	z-index: 2;
}

.am-cta-grid {
	display: grid;
	gap: 80px;
	grid-template-columns: 1.3fr auto;
	align-items: center;
}

.am-cta-title {
	margin: 0 0 var(--am-space-5);
	max-width: 16ch;
	color: var(--am-on-dark);
	font-size: var(--am-h2);
	line-height: 1.2;
}

.am-cta-lead {
	margin: 0;
	max-width: 46ch;
	color: rgba(255, 255, 255, 0.82);
	font-size: var(--am-text-lg);
	line-height: 1.7;
}

.am-cta-actions {
	display: flex;
	flex-direction: column;
	gap: var(--am-space-4);
	min-width: 240px;
}

.am-cta-actions .am-btn {
	justify-content: center;
}

.am-cta-note {
	margin: var(--am-space-4) 0 0;
	color: rgba(255, 255, 255, 0.62);
	font-size: var(--am-text-xs);
	text-align: center;
}

@media (max-width: 880px) {
	.am-cta-grid {
		grid-template-columns: 1fr;
		gap: var(--am-space-6);
	}

	.am-cta-title {
		max-width: none;
	}
}

/* ------------------------------------------------------------------ gallery */
/*
 * Hovering one photo pushes the rest back: they shrink, blur and desaturate
 * while the one under the pointer lifts. Everything is a transform or a filter,
 * so the browser animates it on the compositor.
 */
.am-photo-grid {
	display: grid;
	gap: var(--am-space-4);
	grid-auto-flow: dense;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	padding: var(--am-space-2);
}

/*
 * The first photo runs two columns and two rows. With a four column grid that
 * turns nine photos into three full rows instead of two and a stub.
 */
@media (min-width: 900px) {
	/* Four fixed columns, so the feature tile plus eight photos fill three
	   whole rows. An auto-fit track count would leave a ragged last row. */
	.am-photo-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.am-photo-grid > .am-photo:first-child {
		grid-column: span 2;
		grid-row: span 2;
		aspect-ratio: auto;
	}
}

.am-photo {
	position: relative;
	display: block;
	margin: 0;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: var(--am-radius-lg);
	box-shadow: var(--am-shadow-sm);
	transition:
		transform 0.7s var(--am-ease),
		filter 0.7s var(--am-ease),
		box-shadow 0.7s var(--am-ease);
}

.am-photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 1.2s var(--am-ease);
}

.am-photo-grid:hover > .am-photo {
	transform: scale(0.93);
	filter: blur(3px) grayscale(80%);
}

.am-photo-grid > .am-photo:hover,
.am-photo-grid > .am-photo:focus-within {
	z-index: 2;
	transform: scale(1.08);
	filter: none;
	box-shadow: 0 18px 44px rgba(12, 32, 20, 0.38);
}

.am-photo-grid > .am-photo:hover img {
	transform: scale(1.08);
}

/* Caption slides up from the bottom of the photo under the pointer. */
.am-photo-caption {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	padding: var(--am-space-6) var(--am-space-4) var(--am-space-4);
	background: linear-gradient(to top, rgba(8, 24, 14, 0.88), rgba(8, 24, 14, 0));
	color: var(--am-on-dark);
	font-size: var(--am-text-sm);
	line-height: 1.35;
	opacity: 0;
	transform: translateY(100%);
	transition: opacity var(--am-slow) var(--am-ease), transform var(--am-slow) var(--am-ease);
}

.am-photo-grid > .am-photo:hover .am-photo-caption,
.am-photo-grid > .am-photo:focus-within .am-photo-caption {
	opacity: 1;
	transform: translateY(0);
}

@media (hover: none) {
	.am-photo-grid:hover > .am-photo {
		transform: none;
		filter: none;
	}

	.am-photo-caption {
		opacity: 1;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.am-photo,
	.am-photo img,
	.am-photo-caption {
		transition: none;
	}

	.am-photo-grid:hover > .am-photo {
		transform: none;
		filter: none;
	}
}

/* ------------------------------------------------------------- reveal hook */
.am-reveal {
	opacity: 0;
	transform: translateY(14px);
	transition: opacity var(--am-slow) var(--am-ease), transform var(--am-slow) var(--am-ease);
}

.am-reveal-in {
	opacity: 1;
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	.am-reveal {
		opacity: 1;
		transform: none;
	}
}
