/*
 * Hero — Glass Trust
 * Port of 21st.dev "glassmorphism-trust-hero".
 *
 * Tailwind classes from the source are quoted next to their CSS equivalents so the two
 * stay traceable. Anything an Elementor control writes is a custom property declared at
 * the top of .cw-ghero.
 */

.cw-ghero {
	/* Palette */
	--cw-bg: #09090b;                              /* zinc-950 */
	--cw-fg: #ffffff;
	--cw-muted: #a1a1aa;                           /* zinc-400 */
	--cw-dim: #71717a;                             /* zinc-500 */

	/* Glass */
	--cw-surface: rgba(255, 255, 255, 0.05);       /* bg-white/5 */
	--cw-surface-hover: rgba(255, 255, 255, 0.1);  /* hover:bg-white/10 */
	--cw-border: rgba(255, 255, 255, 0.1);         /* border-white/10 */
	--cw-border-strong: rgba(255, 255, 255, 0.2);  /* hover:border-white/20 */
	--cw-blur: 24px;                               /* backdrop-blur-xl */
	--cw-glow: rgba(255, 255, 255, 0.05);
	--cw-card-radius: 1.5rem;                      /* rounded-3xl */
	--cw-card-padding: 2rem;                       /* p-8 */

	/* Layout */
	--cw-max-width: 1280px;                        /* max-w-7xl */
	--cw-grid-gap: 2rem;                           /* lg:gap-8 */
	--cw-stack-gap: 2rem;                          /* space-y-8 */
	--cw-col-left: 7;                              /* lg:col-span-7 */
	--cw-col-right: 5;                             /* lg:col-span-5 */
	--cw-col-offset: 48px;                         /* lg:mt-12 */

	/* Type */
	--cw-title-size: 6rem;                         /* xl:text-8xl */
	--cw-grad-from: #ffffff;
	--cw-grad-via: #ffffff;
	--cw-grad-to: #ffcd75;
	--cw-grad-angle: 135deg;                       /* bg-gradient-to-br */

	/* Stats */
	--cw-track: rgba(39, 39, 42, 0.5);             /* bg-zinc-800/50 */
	--cw-track-height: 8px;                        /* h-2 */
	--cw-fill-from: #ffffff;
	--cw-fill-to: #a1a1aa;
	--cw-pill-marker: #22c55e;

	/* Marquee */
	--cw-marquee-duration: 40s;
	--cw-marquee-gap: 3rem;                        /* gap-12 */
	--cw-marquee-opacity: 0.5;
	--cw-marquee-shift: -50%;

	/* Motion */
	--cw-anim-duration: 0.8s;
	--cw-bg-fade-stop: 70%;

	position: relative;
	width: 100%;
	overflow: hidden;
	background-color: var(--cw-bg);
	color: var(--cw-fg);
}

/* --------------------------------------------------------------------- Background */

.cw-ghero__bg {
	position: absolute;
	inset: 0;
	z-index: 0;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	opacity: 0.4;
	pointer-events: none;
}

.cw-ghero--bg-fade .cw-ghero__bg {
	-webkit-mask-image: linear-gradient(180deg, transparent, #000 0%, #000 var(--cw-bg-fade-stop), transparent);
	mask-image: linear-gradient(180deg, transparent, #000 0%, #000 var(--cw-bg-fade-stop), transparent);
}

/* ------------------------------------------------------------------------- Layout */

.cw-ghero__container {
	position: relative;
	z-index: 1;
	max-width: var(--cw-max-width);
	margin-inline: auto;
	padding: 8rem 2rem 5rem; /* pt-32 px-8 pb-20 */
}

.cw-ghero__grid {
	display: flex;
	flex-direction: column;
	gap: 3rem; /* gap-12 */
	align-items: stretch;
}

.cw-ghero__col--text {
	display: flex;
	flex-direction: column;
	gap: var(--cw-stack-gap);
	justify-content: center;
	min-width: 0;
}

.cw-ghero__col--cards {
	display: flex;
	flex-direction: column;
	gap: 1.5rem; /* space-y-6 */
	min-width: 0;
}

@media (min-width: 1024px) {
	.cw-ghero__grid {
		flex-direction: row;
		flex-wrap: nowrap;
		gap: var(--cw-grid-gap);
		align-items: flex-start;
	}

	/* The 12-column split, expressed as a share of the space left after the gap. */
	.cw-ghero__col--text {
		flex: 0 0 calc((100% - var(--cw-grid-gap)) * var(--cw-col-left) / 12);
		max-width: calc((100% - var(--cw-grid-gap)) * var(--cw-col-left) / 12);
		padding-top: 2rem; /* pt-8 */
	}

	.cw-ghero__col--cards {
		flex: 1 1 0;
		margin-top: var(--cw-col-offset);
	}

	.cw-ghero--flip .cw-ghero__col--text {
		order: 2;
	}

	.cw-ghero--flip .cw-ghero__col--cards {
		order: 1;
	}
}

/* --------------------------------------------------------------------------- Logo */

.cw-ghero__logo {
	display: flex;
}

.cw-ghero .cw-ghero__logo img {
	width: 160px;
	height: auto;
	max-width: 100%;
}

/* -------------------------------------------------------------------------- Badge */

.cw-ghero__row {
	display: flex;
}

.cw-ghero__badge {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	border-width: 1px;
	border-color: var(--cw-border);
	border-radius: 9999px;
	background-color: var(--cw-surface);
	padding: 0.375rem 0.75rem; /* px-3 py-1.5 */
	color: #d4d4d8; /* zinc-300 */
	-webkit-backdrop-filter: blur(calc(var(--cw-blur) / 2));
	backdrop-filter: blur(calc(var(--cw-blur) / 2));
	transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}

a.cw-ghero__badge:hover {
	background-color: var(--cw-surface-hover);
}

.cw-ghero__badge-text {
	font-size: 0.625rem; /* text-[10px] */
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

@media (min-width: 640px) {
	.cw-ghero__badge-text {
		font-size: 0.75rem; /* sm:text-xs */
	}
}

.cw-ghero__badge .cw-icon {
	width: 0.875rem;
	height: 0.875rem;
	color: #facc15; /* yellow-400 */
}

/* ------------------------------------------------------------------------ Heading */

.cw-w .cw-ghero__title {
	font-size: clamp(3rem, 1.6rem + 5vw, var(--cw-title-size));
	font-weight: 500;
	line-height: 0.9;
	letter-spacing: -0.05em; /* tracking-tighter */
	color: var(--cw-fg);
}

.cw-w .cw-ghero--title-fade .cw-ghero__title {
	-webkit-mask-image: linear-gradient(180deg, #000 0%, #000 80%, transparent 100%);
	mask-image: linear-gradient(180deg, #000 0%, #000 80%, transparent 100%);
}

.cw-w .cw-ghero__title-line {
	display: block;
}

.cw-w .cw-ghero__title-gradient {
	background-image: linear-gradient(
		var(--cw-grad-angle),
		var(--cw-grad-from) 0%,
		var(--cw-grad-via) 50%,
		var(--cw-grad-to) 100%
	);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	/* Keeps descenders from clipping when the gradient is clipped to the glyphs. */
	padding-bottom: 0.05em;
}

/* -------------------------------------------------------------------- Description */

.cw-ghero__description {
	max-width: 36rem; /* max-w-xl */
	font-size: 1.125rem; /* text-lg */
	line-height: 1.625; /* leading-relaxed */
	color: var(--cw-muted);
}

/* ------------------------------------------------------------------------ Buttons */

.cw-ghero__actions {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

@media (min-width: 640px) {
	.cw-ghero__actions {
		flex-direction: row;
		flex-wrap: wrap;
		align-items: center;
	}
}

.cw-w .cw-ghero__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	border-radius: 9999px;
	padding: 1rem 2rem; /* px-8 py-4 */
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.25rem;
	text-align: center;
	transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease,
		transform 200ms ease;
}

.cw-w .cw-ghero__btn--primary {
	background-color: #ffffff;
	color: var(--cw-bg);
}

.cw-w .cw-ghero__btn--primary:hover {
	background-color: #e4e4e7; /* zinc-200 */
	color: var(--cw-bg);
	transform: scale(1.02);
}

.cw-w .cw-ghero__btn--primary:active {
	transform: scale(0.98);
}

.cw-w .cw-ghero__btn--secondary {
	border-width: 1px;
	border-color: var(--cw-border);
	background-color: var(--cw-surface);
	color: var(--cw-fg);
	-webkit-backdrop-filter: blur(calc(var(--cw-blur) / 3));
	backdrop-filter: blur(calc(var(--cw-blur) / 3));
}

.cw-w .cw-ghero__btn--secondary:hover {
	background-color: var(--cw-surface-hover);
	border-color: var(--cw-border-strong);
	color: var(--cw-fg);
}

.cw-w .cw-ghero__btn .cw-icon {
	width: 1rem;
	height: 1rem;
	transition: transform 200ms ease;
}

.cw-w .cw-ghero__btn--primary:hover .cw-icon {
	transform: translateX(4px);
}

/* --------------------------------------------------------------------- Glass card */

.cw-ghero__card {
	position: relative;
	overflow: hidden;
	border-width: 1px;
	border-color: var(--cw-border);
	border-radius: var(--cw-card-radius);
	background-color: var(--cw-surface);
	-webkit-backdrop-filter: blur(var(--cw-blur));
	backdrop-filter: blur(var(--cw-blur));
}

.cw-ghero__card--stats {
	padding: var(--cw-card-padding);
	box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25); /* shadow-2xl */
}

.cw-ghero__card-glow {
	display: none;
	position: absolute;
	top: 0;
	right: 0;
	width: 16rem;
	height: 16rem;
	margin: -4rem -4rem 0 0;
	border-radius: 9999px;
	background-color: var(--cw-glow);
	filter: blur(64px);
	pointer-events: none;
}

.cw-ghero--glow .cw-ghero__card-glow {
	display: block;
}

.cw-ghero__card-body {
	position: relative;
	z-index: 1;
}

/* --------------------------------------------------------------------- Stats card */

.cw-ghero__stat-head {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-bottom: 2rem;
}

.cw-ghero__stat-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 3rem;
	height: 3rem;
	border-radius: 1rem; /* rounded-2xl */
	background-color: rgba(255, 255, 255, 0.1);
	box-shadow: inset 0 0 0 1px var(--cw-border-strong); /* ring-1 ring-white/20 */
	color: var(--cw-fg);
}

.cw-ghero__stat-icon .cw-icon {
	width: 50%;
	height: 50%;
}

.cw-ghero__stat-value {
	font-size: 1.875rem; /* text-3xl */
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.025em;
	color: var(--cw-fg);
}

.cw-ghero__stat-label {
	font-size: 0.875rem;
	line-height: 1.4;
	color: var(--cw-muted);
}

.cw-ghero__bars {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	margin-bottom: 2rem;
}

.cw-ghero__bar {
	display: flex;
	flex-direction: column;
	gap: 0.75rem; /* space-y-3 */
}

.cw-ghero__bar-head {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	font-size: 0.875rem;
	line-height: 1.25rem;
}

.cw-ghero__bar-label {
	color: var(--cw-muted);
}

.cw-ghero__bar-value {
	font-weight: 500;
	color: var(--cw-fg);
}

.cw-ghero__bar-track {
	width: 100%;
	height: var(--cw-track-height);
	overflow: hidden;
	border-radius: 9999px;
	background-color: var(--cw-track);
}

.cw-ghero__bar-fill {
	height: 100%;
	border-radius: 9999px;
	background-image: linear-gradient(to right, var(--cw-fill-from), var(--cw-fill-to));
	transition: width 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

.cw-ghero__divider {
	height: 1px;
	width: 100%;
	margin-bottom: 1.5rem;
	background-color: var(--cw-border);
}

.cw-ghero__mini {
	display: flex;
	align-items: stretch;
	gap: 1rem;
}

.cw-ghero__mini-item {
	display: flex;
	flex: 1 1 0;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	gap: 0.125rem;
	cursor: default;
	transition: transform 200ms ease;
}

.cw-ghero__mini-item:hover {
	transform: translateY(-4px);
}

.cw-ghero--mini-rules .cw-ghero__mini-item + .cw-ghero__mini-item {
	border-left-width: 1px;
	border-left-color: var(--cw-border);
	padding-left: 1rem;
}

.cw-ghero__mini-value {
	font-size: 1.25rem; /* text-xl */
	font-weight: 700;
	line-height: 1.2;
	color: var(--cw-fg);
}

.cw-ghero__mini-label {
	font-size: 0.625rem;
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--cw-dim);
}

@media (min-width: 640px) {
	.cw-ghero__mini-value {
		font-size: 1.5rem; /* sm:text-2xl */
	}

	.cw-ghero__mini-label {
		font-size: 0.75rem;
	}
}

.cw-ghero__pills {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 2rem;
}

.cw-ghero__pill {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	border-width: 1px;
	border-color: var(--cw-border);
	border-radius: 9999px;
	background-color: var(--cw-surface);
	padding: 0.25rem 0.75rem;
	font-size: 0.625rem;
	font-weight: 500;
	line-height: 1.6;
	letter-spacing: 0.025em;
	color: #d4d4d8;
}

.cw-ghero__pill .cw-icon {
	width: 0.75rem;
	height: 0.75rem;
	color: var(--cw-pill-marker);
}

.cw-ghero__dot {
	position: relative;
	display: inline-flex;
	width: 0.5rem;
	height: 0.5rem;
	flex: 0 0 auto;
}

.cw-ghero__dot-ping {
	position: absolute;
	inset: 0;
	border-radius: 9999px;
	background-color: var(--cw-pill-marker);
	opacity: 0.75;
	animation: cw-ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.cw-ghero__dot-core {
	position: relative;
	width: 0.5rem;
	height: 0.5rem;
	border-radius: 9999px;
	background-color: var(--cw-pill-marker);
}

@keyframes cw-ping {
	75%,
	100% {
		transform: scale(2);
		opacity: 0;
	}
}

/* ------------------------------------------------------------------- Marquee card */

.cw-ghero__card--marquee {
	padding: var(--cw-card-padding) 0;
}

.cw-ghero__marquee-title {
	margin-bottom: 1.5rem;
	padding-inline: var(--cw-card-padding);
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1.4;
	color: var(--cw-muted);
}

.cw-ghero__marquee {
	position: relative;
	display: flex;
	overflow: hidden;
}

.cw-ghero--marquee-fade .cw-ghero__marquee {
	-webkit-mask-image: linear-gradient(to right, transparent, #000 20%, #000 80%, transparent);
	mask-image: linear-gradient(to right, transparent, #000 20%, #000 80%, transparent);
}

.cw-ghero__marquee-track {
	display: flex;
	width: max-content;
	animation: cw-marquee var(--cw-marquee-duration) linear infinite;
}

.cw-ghero__marquee-track.is-reverse {
	animation-direction: reverse;
}

/* The trailing padding makes each group exactly one loop step wide, so shifting by
   -100/copies% lands seamlessly on the next copy. */
.cw-ghero__marquee-group {
	display: flex;
	align-items: center;
	gap: var(--cw-marquee-gap);
	padding-right: var(--cw-marquee-gap);
}

.cw-ghero--pause .cw-ghero__marquee:hover .cw-ghero__marquee-track {
	animation-play-state: paused;
}

@keyframes cw-marquee {
	from {
		transform: translateX(0);
	}
	to {
		transform: translateX(var(--cw-marquee-shift));
	}
}

.cw-ghero__marquee-item {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	white-space: nowrap;
	color: var(--cw-fg);
	opacity: var(--cw-marquee-opacity);
	cursor: default;
	transition: opacity 300ms ease, transform 300ms ease, filter 300ms ease;
}

a.cw-ghero__marquee-item {
	cursor: pointer;
}

.cw-ghero--grayscale .cw-ghero__marquee-item {
	filter: grayscale(1);
}

.cw-ghero__marquee-item:hover {
	opacity: 1;
	transform: scale(1.05);
	filter: grayscale(0);
}

.cw-ghero__marquee-item .cw-icon {
	width: 1.5rem;
	height: 1.5rem;
}

.cw-ghero .cw-ghero__marquee-logo {
	height: 1.5rem;
	width: auto;
	object-fit: contain;
}

.cw-ghero__marquee-text {
	font-size: 1.125rem; /* text-lg */
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: -0.025em;
}

/* ------------------------------------------------------------------------- Motion */

.cw-ghero--animate .cw-anim {
	opacity: 0;
	animation: cw-fade-slide var(--cw-anim-duration) ease-out forwards;
	animation-delay: var(--cw-anim-delay, 0s);
}

@keyframes cw-fade-slide {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.cw-ghero--animate .cw-anim {
		opacity: 1;
		animation: none;
	}

	.cw-ghero__marquee-track {
		animation: none;
	}

	.cw-ghero__dot-ping {
		animation: none;
	}
}

/* ------------------------------------------------------------------------- Mobile */

@media (max-width: 767px) {
	.cw-ghero__container {
		padding: 6rem 1.25rem 3rem; /* pt-24 px-4 pb-12 */
	}

	.cw-w .cw-ghero__btn {
		width: 100%;
	}

	.cw-ghero__mini {
		gap: 0.5rem;
	}

	.cw-ghero--mini-rules .cw-ghero__mini-item + .cw-ghero__mini-item {
		padding-left: 0.5rem;
	}
}

/* -------------------------------------------------------------------- Reviews card */

.cw-ghero__card--reviews {
	padding: var(--cw-card-padding);
	box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25); /* shadow-2xl, matches stats card */
}

.cw-ghero__reviews {
	--cw-reviews-gap: 12px;
	--cw-star: #fbbc04;
	--cw-star-size: 28px;

	display: block;
	text-align: center;
	text-decoration: none;
	color: inherit;
}

a.cw-ghero__reviews {
	transition: opacity 0.2s ease;
}

a.cw-ghero__reviews:hover,
a.cw-ghero__reviews:focus-visible {
	opacity: 0.85;
}

/* The scoped reset sets `.cw-w img { display: block }` at specificity (0,1,1), which
   outranks a single class. Two classes (0,2,0) win it back, so the image becomes an
   inline-block and the card's text-align can position it like any other line. */
.cw-ghero__reviews .cw-ghero__reviews-image {
	display: inline-block;
	width: 220px;
	max-width: 100%;
	height: auto;
}

.cw-ghero__reviews-text {
	margin: 0;
	font-size: 1rem;
	font-weight: 500;
	line-height: 1.5;
	color: var(--cw-fg);
}

.cw-ghero__reviews-subtext {
	display: block;
	font-size: 0.875rem;
	line-height: 1.4;
	color: var(--cw-muted);
}

/* --------------------------------------------------------- Reviews vertical rhythm
 *
 * Both selectors are deliberately two classes deep. The scoped reset zeroes margins on
 * `.cw-w p` (and h1-h6, ul, ol, figure...) at specificity 0,1,1 — a single-class rule
 * loses to it, so `.cw-ghero__reviews > * + *` alone silently does nothing whenever the
 * next element happens to be a paragraph. 0,2,0 beats 0,1,1 and wins the cascade.
 *
 * Keep these below the element rules above too: `.cw-ghero__reviews-text` resets its
 * margin with the `margin` shorthand, and at equal specificity source order decides.
 *
 * Spacing hangs off the following sibling rather than the element itself, so it
 * collapses on its own when a piece is absent instead of leaving a stray gap.
 */
.cw-ghero__card--reviews .cw-ghero__reviews > * + * {
	margin-top: var(--cw-reviews-gap);
}

/* Whatever follows the image owns the space below it — the text, or the star row. */
.cw-ghero__card--reviews .cw-ghero__reviews-image + * {
	margin-top: var(--cw-reviews-image-gap, var(--cw-reviews-gap));
}

/* ------------------------------------------------------------------ Star rating row */

.cw-ghero__stars {
	position: relative;
	display: inline-block;
	line-height: 0;
}

.cw-ghero__stars-base,
.cw-ghero__stars-fill {
	display: flex;
	gap: 0.15em;
	white-space: nowrap;
}

.cw-ghero__stars-base {
	color: var(--cw-border-strong, rgb(255 255 255 / 0.25));
}

/* Coloured layer sits on top, clipped to the rating so halves render exactly. */
.cw-ghero__stars-fill {
	position: absolute;
	inset: 0;
	width: var(--cw-stars-fill, 100%);
	overflow: hidden;
	color: var(--cw-star);
}

.cw-ghero__stars .cw-icon {
	width: var(--cw-star-size);
	height: var(--cw-star-size);
	flex: 0 0 auto;
}

/* --------------------------------------------------------------------- Stat counters */

/* Lining figures keep the number from reflowing digit-by-digit while counting. */
.cw-ghero__stat-value[data-cw-count],
.cw-ghero__mini-value[data-cw-count],
.cw-ghero__bar-value[data-cw-count] {
	font-variant-numeric: tabular-nums;
	font-feature-settings: "tnum";
	display: inline-block;
}
