/* Hero — typography + layout mirror the service-single v2 style (Cloudways /services/development/).
   Uses the home brand palette (deep red) instead of service-single's rose. */

.fp-hero-v2 {
	--fp-hero-ink:           #09090b;
	--fp-hero-body:          #3f3f46;
	--fp-hero-body-soft:     #52525b;
	--fp-hero-surface-soft:  #fafafa;
	--fp-hero-border:        #e4e4e7;
	--fp-hero-accent:        #790000;     /* brand deep-red — matches hero text */
	--fp-hero-accent-2:      #a50000;
	--fp-hero-accent-deep:   #5c0000;
	--fp-hero-accent-soft:   rgba(121, 0, 0, 0.10);
	--fp-hero-accent-chip:   rgba(121, 0, 0, 0.14);
	--fp-hero-accent-ring:   rgba(121, 0, 0, 0.22);
	--fp-hero-font-heading:  'Space Grotesk', 'Inter', system-ui, -apple-system, sans-serif;
	--fp-hero-font-body:     'Manrope', 'Inter', system-ui, -apple-system, sans-serif;
	--fp-hero-shadow-md:     0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);

	position: relative;
	overflow: hidden;
	background: linear-gradient(32deg, #ffffff 0%, rgba(255, 255, 255, 0.8) 50%, var(--fp-hero-accent-soft) 100%);
	padding: 160px 0 144px;
	border-bottom: 1px solid var(--fp-hero-border);
	color: var(--fp-hero-ink);
	font-family: var(--fp-hero-font-body);
}

.fp-hero-v2__glow {
	position: absolute;
	inset: auto -10% -40% auto;
	width: 780px;
	height: 520px;
	background: radial-gradient(circle at 70% 40%, var(--fp-hero-accent-soft) 0%, transparent 70%);
	filter: blur(60px);
	pointer-events: none;
	z-index: 0;
}

.fp-hero-v2__container {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: var(--container-width);
	margin: 0 auto;
	padding: 0 32px;
}

.fp-hero-v2__grid {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	gap: 64px;
	align-items: center;
}

.fp-hero-v2__copy {
	display: flex;
	flex-direction: column;
}

.fp-hero-v2__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-right: auto;
	padding: 6px 12px;
	background: rgba(121, 0, 0, 0.10);
	border-radius: 6px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: #790000;
}

.fp-hero-v2__eyebrow-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #790000;
}

.fp-hero-v2__title {
	margin: 28px 0 24px;
	font-family: var(--fp-hero-font-heading);
	font-weight: 700;
	font-size: clamp(44px, 5.3vw, 72px);
	line-height: 1.05;
	letter-spacing: -0.03em;
	color: var(--fp-hero-ink);
}

.fp-hero-v2__title-line { display: block; }

.fp-hero-v2__title-line--accent {
	background: linear-gradient(123deg, #790000 0%, #a50000 100%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
}

.fp-hero-v2__lead {
	margin: 0 0 32px;
	max-width: 540px;
	font-size: 19px;
	line-height: 1.6;
	font-weight: 300;
	color: var(--fp-hero-body);
}

.fp-hero-v2__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
}

.fp-hero-v2__btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 16px 32px;
	font-family: var(--fp-hero-font-body);
	font-weight: 700;
	font-size: 15px;
	line-height: 1.5;
	letter-spacing: 0.02em;
	text-decoration: none;
	border-radius: 6px;
	border: 1px solid transparent;
	transition: transform .2s ease, box-shadow .25s ease, background-color .2s ease, border-color .2s ease;
	cursor: pointer;
	white-space: nowrap;
}

.fp-hero-v2__btn-icon {
	display: inline-flex;
	width: 16px;
	height: 16px;
	align-items: center;
	justify-content: center;
}

.fp-hero-v2__btn-icon svg { width: 100%; height: 100%; }

.fp-hero-v2__btn--primary {
	color: #fff;
	background-image: linear-gradient(135deg, var(--fp-hero-accent) 0%, var(--fp-hero-accent-2) 100%);
	box-shadow: var(--fp-hero-shadow-md);
}

.fp-hero-v2__btn--primary:hover {
	transform: translateY(-1px);
	box-shadow: 0 14px 20px -5px rgba(121, 0, 0, 0.28), 0 6px 8px -4px rgba(121, 0, 0, 0.22);
}

.fp-hero-v2__btn--primary:focus-visible {
	outline: 2px solid var(--fp-hero-accent);
	outline-offset: 3px;
}

.fp-hero-v2__btn--ghost {
	color: var(--fp-hero-ink);
	background: transparent;
	border-color: var(--fp-hero-border);
}

.fp-hero-v2__btn--ghost:hover {
	background: var(--fp-hero-surface-soft);
	border-color: #d4d4d8;
}

.fp-hero-v2__btn--ghost:focus-visible {
	outline: 2px solid var(--fp-hero-accent);
	outline-offset: 3px;
}

.fp-hero-v2__visual {
	position: relative;
	width: 100%;
	/* Was 85% with margin-right:0 — vanilla-tilt rotation (~7deg) pushed the
	   dark-navy card off the viewport edge. Tighter cap + right gutter keeps
	   the rotated bounding box inside the container. */
	max-width: 78%;
	margin-left: auto;
	margin-right: 24px;
}

.fp-hero-v2__visual-halo {
	position: absolute;
	inset: -24px;
	background: var(--fp-hero-accent-soft);
	border-radius: 50%;
	filter: blur(64px);
	opacity: .9;
	pointer-events: none;
	z-index: 0;
	transition: opacity .35s ease;
}

.fp-hero-v2__stage {
	position: relative;
	z-index: 1;
}

.fp-hero-v2__stat {
	position: absolute;
	bottom: -24px;
	left: -24px;
	z-index: 2;
	background: #fff;
	border: 1px solid rgba(228, 228, 231, .6);
	border-radius: 12px;
	padding: 20px 24px;
	max-width: 200px;
	box-shadow: 0 14px 30px -14px rgba(15, 23, 42, .22);
}

.fp-hero-v2__stat-value {
	color: #790000;
	font-family: var(--fp-hero-font-heading);
	font-weight: 700;
	font-size: 28px;
	line-height: 1;
}

.fp-hero-v2__stat-label {
	color: var(--fp-hero-body-soft);
	font-size: 12px;
	font-weight: 700;
	text-transform: capitalize;
	letter-spacing: .06em;
	margin-top: 6px;
}

/* Responsive tweaks mirror the service-single breakpoints. */
@media (max-width: 1024px) {
	.fp-hero-v2 { padding: 120px 0 100px; }
	.fp-hero-v2__grid { gap: 40px; }
	.fp-hero-v2__title { font-size: clamp(40px, 6vw, 66px); }
}

@media (max-width: 860px) {
	.fp-hero-v2 { padding: 110px 0 90px; }
	.fp-hero-v2__grid { grid-template-columns: minmax(0, 1fr); gap: 56px; }
	.fp-hero-v2__title { font-size: 41px; line-height: 1.1; margin: 22px 0 18px; }
	.fp-hero-v2__lead { font-size: 17px; line-height: 1.6; }
	.fp-hero-v2__btn { width: 100%; justify-content: center; padding: 15px 24px; }
	.fp-hero-v2__btn--ghost { display: none; }
	.fp-hero-v2__visual { max-width: 100%; margin-inline: auto; }
	.fp-hero-v2__stat { bottom: -18px; left: 12px; padding: 16px 18px; max-width: 180px; }
}

/* Three.js stage wrapper — dark card that holds the canvas + snapshot bg.
   Classes `.stage-wrap` and `.bg-image` are used here because hero-demo-engine.js
   targets `#stage` and `#bg-image` by id. */

.stage-wrap {
	position: relative;
	aspect-ratio: 1 / 1;
	width: 100%;
	border-radius: 18px;
	background:
		radial-gradient(120% 80% at 80% 18%, rgba(139, 92, 246, .28) 0%, transparent 60%),
		radial-gradient(90% 70% at 18% 90%, rgba(59, 130, 246, .20) 0%, transparent 60%),
		linear-gradient(180deg, #0d1133 0%, #06070f 100%);
	border: 1px solid #1f2447;
	overflow: hidden;
	box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .55);
}

/* aspect-ratio fallback for iOS Safari < 15 (no `aspect-ratio` support). Without
   it .stage-wrap collapses to 0 height and the canvas/poster (absolute, inset:0)
   have nothing to fill — the hero looks empty. A padding-top:100% spacer forces
   the 1:1 box. Modern browsers skip this block (they support aspect-ratio). */
@supports not (aspect-ratio: 1 / 1) {
	.stage-wrap::before {
		content: "";
		display: block;
		padding-top: 100%;
	}
}

.stage-wrap .bg-image {
	position: absolute;
	inset: 0;
	opacity: 0;
	transition: opacity .35s ease, filter .35s ease, transform .35s ease;
	pointer-events: none;
	z-index: 0;

	/* Promote to its own composited layer so the opacity/transform tweens
	   driven by hero-demo-engine.js run on the GPU. Without this hint the
	   browser falls back to main-thread paint and Lighthouse flags it as
	   "Avoid non-composited animations". */
	will-change: opacity, transform;
	transform: translateZ(0);
	backface-visibility: hidden;
}

/* Hero poster — static fallback. Visibility is controlled by the HTML `hidden`
   attribute (set in the markup, toggled by the loader JS), NOT by CSS — so a
   stale or missing stylesheet can never leave it showing on modern browsers.
   These rules only POSITION it when it's revealed (engine couldn't run):
   full-bleed over the gradient backdrop + snapshot bg-image (z0), below the
   canvas (z2). */
.stage-wrap .hero-poster {
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
}
.stage-wrap .hero-poster img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.stage-wrap #stage {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: block;
	z-index: 2;

	/* Canvas is hidden until the Three.js engine has rendered its first
	   frame. The JS loader adds .is-engine-ready and the canvas fades in.
	   • Desktop: 250 ms — quick swap (no poster crossfade to coordinate
	     with, the wrap's gradient backdrop is neutral).
	   • Mobile:  600 ms — coordinates with the poster fade-out for a
	     smooth crossfade. */
	opacity: 0;
	transition: opacity 250ms ease;
	will-change: opacity;
}

.stage-wrap.is-engine-ready #stage {
	opacity: 1;
}

@media (max-width: 900px) {
	.stage-wrap #stage {
		transition: opacity 600ms ease;
	}
}

/* ============================================================
   Architectural Workflow header — sits above the svc-k__services
   grid on the home page. Top spacing pushes it away from the hero,
   negative bottom margin pulls the grid up to compensate for the
   .svc-k__services { padding: 96px 0 } so we don't get a 200px gap.
   ============================================================ */
.fp-workflow-head {
	margin-top: 4rem;
	margin-bottom: -2rem;
}

/* ============================================================
   Bottom CTA strip — .cta-band (replaces the legacy "Transmute" CTA).
   Ported from designs/styles/home.css with square (6px) buttons.
   ============================================================ */
.cta-band {
	background: #191c1d;
	color: #fff;
	padding: 96px 24px;
	text-align: center;
	position: relative;
	overflow: hidden;
}
.cta-band::before {
	content: '';
	position: absolute;
	inset: 0;
	background: radial-gradient(ellipse at center top, rgba(121, 0, 0, 0.36), transparent 60%);
	pointer-events: none;
}
.cta-band__inner {
	max-width: 880px;
	margin: 0 auto;
	position: relative;
	z-index: 1;
}
.cta-band__eyebrow {
	font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
	font-size: 12px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	font-weight: 700;
	color: #ffb4a8;
	margin: 0 0 16px;
}
.cta-band h2 {
	font-family: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
	font-size: clamp(36px, 5vw, 64px);
	letter-spacing: -0.025em;
	line-height: 1.05;
	margin: 0 0 24px;
	color: #fff;
	text-wrap: balance;
	font-weight: 700;
}
.cta-band p {
	font-size: 17px;
	color: #c9ccd0;
	max-width: 560px;
	margin: 0 auto 32px;
	line-height: 1.55;
}
.cta-band__buttons {
	display: flex;
	gap: 14px;
	justify-content: center;
	flex-wrap: wrap;
}
.cta-band__btn-primary,
.cta-band__btn-ghost {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 16px 28px;
	border-radius: 6px;
	font-weight: 700;
	font-size: 15px;
	text-decoration: none;
	border: 0;
	cursor: pointer;
	transition: background 150ms ease, border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}
.cta-band__btn-primary {
	background: #790000;
	color: #fff;
	box-shadow: 0 14px 30px -10px rgba(121, 0, 0, 0.55);
}
.cta-band__btn-primary:hover {
	background: #a50000;
	transform: translateY(-1px);
	color: #fff;
}
.cta-band__btn-ghost {
	background: transparent;
	color: #fff;
	padding: 15px 24px;
	border: 1px solid rgba(255, 255, 255, 0.24);
}
.cta-band__btn-ghost:hover {
	background: rgba(255, 255, 255, 0.08);
	border-color: rgba(255, 255, 255, 0.5);
	color: #fff;
}

@media (max-width: 640px) {
	.cta-band { padding: 64px 18px; }
	.cta-band__btn-primary,
	.cta-band__btn-ghost { width: 100%; justify-content: center; }
}
