/**
 * Hero.
 *
 * Design intent: this page is read by procurement and security officers at
 * organisations like the MoD. The register is engineered precision, not
 * marketing. That means a tight confident headline, visible structure, and
 * assurance signalling above the fold rather than buried down the page.
 */

.hero {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	min-height: clamp(460px, 68vh, 760px);
	padding-top: var(--sp-2xl);
	background-color: var(--c-black);
	color: var(--c-grey-300);
	overflow: hidden;
	isolation: isolate;
}

/* Technical ground. A fine grid plus a directional wash, so the dark band
   reads as engineered surface rather than an empty black box. The previous
   version left the right-hand half of the hero visually dead. */
.hero::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -2;
	background-image:
		linear-gradient(to right, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
		linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
		radial-gradient(120% 90% at 78% 15%, rgba(1, 113, 185, 0.5), transparent 62%),
		radial-gradient(80% 70% at 100% 100%, rgba(35, 182, 222, 0.2), transparent 60%);
	background-size: 72px 72px, 72px 72px, 100% 100%, 100% 100%;
	pointer-events: none;
}

.hero__media {
	position: absolute;
	inset: 0;
	z-index: -3;
}

.hero__image,
.hero__video {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.hero__overlay {
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(
		92deg,
		rgba(11, 14, 19, 0.95) 0%,
		rgba(11, 14, 19, 0.82) 48%,
		rgba(11, 14, 19, 0.5) 100%
	);
	pointer-events: none;
}

.hero__inner {
	position: relative;
	width: 100%;
	padding-bottom: var(--sp-2xl);
}

.hero__layout--split {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
	gap: var(--sp-2xl);
	align-items: center;
}

/* Measure.
 *
 * Deliberately set in rem, not ch. A ch unit resolves against the element's
 * own font size, so putting it on this wrapper (16px) clamped the whole
 * column to roughly 130px and wrapped the headline onto four lines. The
 * headline and standfirst carry their own measures below. */
.hero__content {
	max-width: 52rem;
}

.hero__layout--split .hero__content {
	max-width: 44rem;
}

/* Eyebrow above the headline, with a short rule. Standard device across
   this category for categorising a page without spending a heading level. */
.hero__eyebrow {
	display: flex;
	align-items: center;
	gap: var(--sp-2xs);
	white-space: nowrap;
	margin-bottom: var(--sp-md);
	color: var(--c-accent);
	font-family: var(--font-heading);
	font-size: var(--fs-xs);
	font-weight: var(--fw-bold);
	letter-spacing: var(--ls-caps);
	text-transform: uppercase;
}

/* No rule before the label: it read as a stray dash next to the text. */

.hero__title {
	/* No explicit measure: the grid column already constrains it, and
	   text-wrap: balance distributes the remainder evenly rather than
	   leaving a single orphaned word. */
	color: var(--c-white);
	font-size: var(--fs-4xl);
	font-weight: var(--fw-black);
	letter-spacing: var(--ls-display);
	line-height: 0.98;
	text-wrap: balance;
}

.hero__subtitle {
	max-width: 34rem;
	margin-top: var(--sp-md);
	color: var(--c-grey-300);
	font-size: var(--fs-lg);
	line-height: var(--lh-snug);
}

.hero__subtitle p {
	margin: 0;
}

.hero__subtitle p + p {
	margin-top: var(--sp-2xs);
}

.hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--sp-xs);
	margin-top: var(--sp-lg);
}

/* Buttons size to their label rather than being squeezed by the column. */
.hero__actions .btn {
	white-space: nowrap;
}

/* --- Assurance bar --------------------------------------------------- */

/* Certifications pinned to the foot of the hero. Procurement in this sector
   looks for FIPS, Common Criteria and NATO accreditation first; putting it
   above the fold is a design decision, not decoration. */
.hero__assurance {
	position: relative;
	border-top: 1px solid rgba(255, 255, 255, 0.14);
	background-color: rgba(11, 14, 19, 0.55);
	backdrop-filter: blur(2px);
}

.hero__assurance-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--sp-sm) var(--sp-lg);
	padding-block: var(--sp-sm);
}

.hero__assurance-label {
	flex: 0 0 auto;
	color: var(--c-grey-500);
	font-family: var(--font-heading);
	font-size: var(--fs-xs);
	font-weight: var(--fw-bold);
	letter-spacing: var(--ls-caps);
	text-transform: uppercase;
}

.hero__assurance-items {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--sp-sm) var(--sp-lg);
	margin: 0;
	padding: 0;
	list-style: none;
}

.hero__assurance-item {
	display: flex;
	align-items: center;
	gap: var(--sp-2xs);
	color: var(--c-grey-200);
	font-family: var(--font-heading);
	font-size: var(--fs-sm);
	font-weight: var(--fw-semibold);
	letter-spacing: 0.01em;
}

.hero__assurance-item::before {
	content: "";
	flex: 0 0 auto;
	width: 6px;
	height: 6px;
	background-color: var(--c-accent);
}

.hero__assurance-item img {
	width: auto;
	max-height: 34px;
	filter: grayscale(1) invert(1) brightness(1.8);
	opacity: 0.9;
}

/* --- Key facts panel ------------------------------------------------- */

/* Occupies the right column when a page has no enquiry form, so the hero is
   never half empty. Reads as a spec plate. */
.hero__panel {
	padding: var(--sp-lg);
	background-color: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: var(--radius-md);
}

.hero__panel-title {
	margin-bottom: var(--sp-sm);
	color: var(--c-grey-500);
	font-family: var(--font-heading);
	font-size: var(--fs-xs);
	font-weight: var(--fw-bold);
	letter-spacing: var(--ls-caps);
	text-transform: uppercase;
}

.hero__panel-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.hero__panel-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--sp-sm);
	padding-block: var(--sp-2xs);
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	font-size: var(--fs-sm);
}

.hero__panel-row:last-child {
	border-bottom: 0;
}

.hero__panel-key {
	color: var(--c-grey-400);
}

.hero__panel-value {
	color: var(--c-white);
	font-family: var(--font-heading);
	font-weight: var(--fw-bold);
	font-variant-numeric: tabular-nums;
	text-align: right;
}

/* Form panel, when a page enables the enquiry layout. */
.hero__form {
	padding: var(--sp-lg);
	background-color: var(--c-white);
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-lg);
	color: var(--c-text);
}

.hero__form :is(h1, h2, h3, h4, h5, h6, label) {
	color: var(--c-heading);
}

/* Video pause control. Required for motion over five seconds:
   WCAG 2.2 AA, 2.2.2 Pause, Stop, Hide. */
.hero__video-toggle {
	position: absolute;
	right: var(--container-gutter);
	top: var(--sp-sm);
	z-index: var(--z-base);
	padding: var(--sp-3xs) var(--sp-2xs);
	background-color: rgba(11, 14, 19, 0.75);
	color: var(--c-white);
	border: 1px solid var(--c-grey-700);
	border-radius: var(--radius-sm);
	font-size: var(--fs-xs);
	cursor: pointer;
}

.hero__video-toggle:hover {
	background-color: var(--c-grey-900);
	border-color: var(--c-grey-500);
}

@media (max-width: 1024px) {
	.hero__layout--split {
		grid-template-columns: 1fr;
		gap: var(--sp-lg);
	}

	.hero__layout--split .hero__content {
		max-width: 52rem;
	}
}

@media (max-width: 782px) {
	.hero {
		min-height: 0;
		padding-top: var(--sp-xl);
	}

	.hero__inner {
		padding-bottom: var(--sp-xl);
	}

	.hero__content,
	.hero__layout--split .hero__content {
		max-width: none;
	}

	.hero__actions .btn {
		white-space: normal;
	}

	.hero__assurance-label {
		width: 100%;
	}
}

/* --- Brand gradient variant ------------------------------------------ */

/*
 * Product-led banner. The dark variant suits an interior page; a home page
 * banner carrying a cut-out product shot needs a lighter ground for the
 * hardware to read against, which is how the live site handles it.
 */
.hero--brand {
	background-color: var(--c-brand-dark);
}

.hero--brand::after {
	background-image:
		linear-gradient(to right, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
		linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
		linear-gradient(118deg, var(--c-brand-darker) 0%, var(--c-brand) 46%, var(--c-brand-light) 100%);
	background-size: 80px 80px, 80px 80px, 100% 100%;
}

.hero--brand .hero__overlay {
	background: linear-gradient(
		100deg,
		rgba(1, 63, 104, 0.88) 0%,
		rgba(1, 90, 148, 0.55) 52%,
		rgba(1, 113, 185, 0.18) 100%
	);
}

.hero--brand .hero__assurance {
	background-color: rgba(1, 63, 104, 0.55);
	border-top-color: rgba(255, 255, 255, 0.22);
}

.hero--brand .hero__assurance-label { color: rgba(255, 255, 255, 0.7); }
.hero--brand .hero__eyebrow         { color: var(--c-white); }
.hero--brand .hero__eyebrow::before { background-color: var(--c-white); }
.hero--brand .hero__subtitle        { color: rgba(255, 255, 255, 0.9); }

.hero--brand .hero__assurance-item::before { background-color: var(--c-white); }

/* --- Product shot ----------------------------------------------------- */

.hero__product {
	display: flex;
	align-items: center;
	justify-content: center;
	/* Lets the hardware break out of the text column's rhythm so it reads
	   as photography rather than another panel. */
	margin-block: calc(var(--sp-xl) * -1);
}

.hero__product-image {
	width: 100%;
	height: auto;
	max-height: 560px;
	object-fit: contain;
	filter: drop-shadow(0 24px 48px rgba(0, 0, 0, 0.45));
}

/* With a product shot the text column can be a touch narrower, which keeps
   the headline tight and gives the hardware room. */
.hero--product .hero__layout--split {
	grid-template-columns: minmax(0, 1fr) minmax(380px, 0.9fr);
	gap: var(--sp-xl);
}

@media (max-width: 1024px) {
	.hero__product {
		margin-block: 0;
		order: -1;
	}

	.hero__product-image {
		max-height: 320px;
	}

	.hero--product .hero__layout--split {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* --- Rotating banner -------------------------------------------------- */

.hero--rotating {
	display: block;
	padding-top: 0;
}

.hero__track {
	position: relative;
	display: grid;
}

/* Slides stack so the banner keeps the height of its tallest slide and
   nothing jumps as it rotates. */
.hero__track > .hero-slide {
	grid-area: 1 / 1;
}

.hero-slide {
	position: relative;
	display: flex;
	align-items: center;
	min-height: clamp(460px, 62vh, 700px);
	padding-block: var(--sp-2xl);
	overflow: hidden;
	isolation: isolate;
	opacity: 0;
	visibility: hidden;
	transition: opacity var(--dur-slow) var(--ease);
}

.hero-slide[data-active="true"] {
	opacity: 1;
	visibility: visible;
}

/* A single, non-rotating hero is always visible. */
.hero:not(.hero--rotating) .hero-slide {
	opacity: 1;
	visibility: visible;
}

.hero-slide--brand { background-color: var(--c-brand-dark); }
.hero-slide--dark  { background-color: var(--c-black); }

.hero-slide::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -2;
	background-image:
		linear-gradient(to right, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
		linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
	background-size: 80px 80px, 80px 80px;
	pointer-events: none;
}

.hero-slide--brand::after {
	background-image:
		linear-gradient(to right, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
		linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
		linear-gradient(118deg, var(--c-brand-darker) 0%, var(--c-brand) 48%, var(--c-brand-light) 100%);
	background-size: 80px 80px, 80px 80px, 100% 100%;
}

.hero-slide--dark::after {
	background-image:
		linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
		linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
		radial-gradient(120% 90% at 76% 18%, rgba(1, 113, 185, 0.5), transparent 62%);
	background-size: 72px 72px, 72px 72px, 100% 100%;
}

.hero-slide__bg {
	position: absolute;
	inset: 0;
	z-index: -3;
}

.hero-slide__bg img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.hero-slide__inner {
	position: relative;
	width: 100%;
}

.hero-slide__layout--split {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(400px, 0.95fr);
	gap: var(--sp-xl);
	align-items: center;
}

/* --- Product lockup --------------------------------------------------- */

.hero__lockup {
	margin-bottom: var(--sp-md);
}

.hero__lockup-image {
	width: auto;
	max-width: min(380px, 60%);
	max-height: 56px;
	object-fit: contain;
	object-position: left center;
}

/* --- Accessible pause control ----------------------------------------- */

/*
 * Visually hidden until focused. The banner rotates on its own, so a pause
 * mechanism is required (WCAG 2.2 AA, 2.2.2); the design does not call for
 * visible controls, so it behaves like the skip link.
 */
.hero__playpause-sr {
	position: absolute;
	left: var(--container-gutter);
	bottom: var(--sp-sm);
	z-index: var(--z-overlay);
	padding: var(--sp-2xs) var(--sp-sm);
	background-color: var(--c-white);
	color: var(--c-brand-dark);
	border: 2px solid var(--c-brand);
	border-radius: var(--radius-sm);
	font-family: var(--font-heading);
	font-size: var(--fs-sm);
	font-weight: var(--fw-bold);
	cursor: pointer;
	opacity: 0;
	transform: translateY(8px);
	pointer-events: none;
	transition: opacity var(--dur-fast) var(--ease),
	            transform var(--dur-fast) var(--ease);
}

.hero__playpause-sr:focus-visible,
.hero__playpause-sr:focus {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

@media (max-width: 1024px) {
	.hero-slide__layout--split {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--sp-lg);
	}

	.hero-slide {
		min-height: 0;
		padding-block: var(--sp-xl);
	}
}

@media (max-width: 600px) {
	.hero__lockup-image { max-width: 70%; max-height: 40px; }
}
