/* ==========================================================================
   CM Digital — Hero
   ========================================================================== */

.hero {
	position: relative;
	overflow: hidden;
	background: var(--bg-primary);
	padding-top: calc(var(--header-height) + var(--space-xl));
	padding-bottom: var(--space-2xl);
}

/* ---- Ambient background ---- */

.hero__background {
	position: absolute;
	inset: 0;
	z-index: 0;
	pointer-events: none;
}

.hero__background::before {
	content: "";
	position: absolute;
	top: -25%;
	right: -15%;
	width: 75vw;
	height: 75vw;
	max-width: 1100px;
	max-height: 1100px;
	background: radial-gradient(circle, rgba(47, 111, 255, 0.22) 0%, rgba(47, 111, 255, 0) 65%);
}

.hero__background::after {
	content: "";
	position: absolute;
	bottom: -35%;
	left: -20%;
	width: 55vw;
	height: 55vw;
	max-width: 750px;
	max-height: 750px;
	background: radial-gradient(circle, rgba(255, 255, 255, 0.035) 0%, rgba(255, 255, 255, 0) 70%);
}

/* An elongated, rotated ellipse (not a plain circle) reads as an "arc" of
   light behind the scene rather than a rectangular glow. */
.hero__glow-core {
	position: absolute;
	top: 6%;
	right: -6%;
	width: 56vw;
	height: 30vw;
	max-width: 900px;
	max-height: 480px;
	background: radial-gradient(ellipse, var(--accent-glow) 0%, rgba(47, 111, 255, 0.12) 45%, rgba(47, 111, 255, 0) 72%);
	transform: rotate(-18deg);
	filter: blur(20px);
}

.hero__glow-arc {
	position: absolute;
	top: 22%;
	right: 2%;
	width: 40vw;
	height: 40vw;
	max-width: 620px;
	max-height: 620px;
	border-radius: 50%;
	border: 1px solid rgba(139, 173, 255, 0.16);
	-webkit-mask-image: linear-gradient(115deg, black, transparent 55%);
	mask-image: linear-gradient(115deg, black, transparent 55%);
}

.hero__beam {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	opacity: 0.5;
}

.hero__grid-overlay {
	position: absolute;
	inset: 0;
	background-image: linear-gradient(var(--border) 1px, transparent 1px),
		linear-gradient(90deg, var(--border) 1px, transparent 1px);
	background-size: 64px 64px;
	opacity: 0.05;
	-webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 75%);
	mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 75%);
}

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

.hero__inner {
	position: relative;
	z-index: 1;
	display: grid;
	/* minmax(0, 1fr), not bare 1fr — a bare track's automatic minimum is
	   "auto" (content-based), which lets a long unbreakable inline-flex
	   child (the eyebrow) blow the column out past the viewport instead
	   of wrapping. minmax(0, ...) removes that floor. */
	grid-template-columns: minmax(0, 1fr);
	gap: var(--space-2xl);
	align-items: center;
	width: 100%;
}

.hero__content {
	min-width: 0;
	max-width: 760px;
}

/* ---- Eyebrow ---- */

.hero__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2xs);
	font-size: var(--fs-eyebrow);
	font-weight: var(--fw-semibold);
	letter-spacing: var(--ls-wide);
	text-transform: uppercase;
	color: var(--accent-300);
	margin-bottom: var(--space-lg);
	opacity: 0;
	animation: hero-rise var(--transition-slow) 80ms forwards;
}

.hero__eyebrow::before {
	content: "";
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--accent-400);
	box-shadow: 0 0 14px 3px var(--accent-glow);
}

/* ---- Headline ---- */

.hero__title {
	font-size: var(--fs-hero);
	line-height: var(--lh-tight);
	letter-spacing: var(--ls-tight);
	margin-bottom: var(--space-lg);
	text-transform: uppercase;
	/* Safety net for the sub-360px end of the viewport range: "OPORTUNIDADES."
	   is one unbreakable word and can outrun even the clamp's floor there. */
	overflow-wrap: break-word;
	word-break: break-word;
}

.hero__title span {
	display: block;
	opacity: 0;
	animation: hero-rise var(--transition-slow) forwards;
}

.hero__title .is-primary {
	color: var(--text-primary);
	animation-delay: 160ms;
}

.hero__title .is-accent {
	color: var(--accent-400);
}

.hero__title .is-accent .hero__title-line:first-child {
	animation-delay: 240ms;
}

.hero__title .is-accent .hero__title-line:last-child {
	animation-delay: 320ms;
}

/* ---- Copy ---- */

.hero__copy {
	font-size: var(--fs-body-lg);
	line-height: var(--lh-body);
	color: var(--text-secondary);
	max-width: 54ch;
	margin-bottom: var(--space-xl);
	opacity: 0;
	animation: hero-rise var(--transition-slow) 400ms forwards;
}

/* ---- CTAs ---- */

.hero__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-md);
	margin-bottom: var(--space-2xl);
	opacity: 0;
	animation: hero-rise var(--transition-slow) 480ms forwards;
}

.hero__actions .btn {
	padding: 1.0625rem 2rem;
	font-size: var(--fs-body-sm);
}

.hero__actions .btn-secondary {
	display: inline-flex;
	align-items: center;
	gap: var(--space-sm);
}

.btn-secondary__play {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	flex-shrink: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.06);
	color: var(--text-primary);
	transition: background-color var(--transition-fast);
}

.btn-secondary:hover .btn-secondary__play,
.btn-secondary:focus-visible .btn-secondary__play {
	background: var(--accent-600);
}

/* ---- Trust points ---- */

.hero__trust {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-lg) var(--space-xl);
	padding-top: var(--space-lg);
	border-top: 1px solid var(--border);
	opacity: 0;
	animation: hero-rise var(--transition-slow) 560ms forwards;
}

.hero__trust li {
	display: flex;
	align-items: center;
	gap: var(--space-sm);
	max-width: 16ch;
}

.hero__trust-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	flex-shrink: 0;
	border-radius: var(--radius-md);
	background: rgba(47, 111, 255, 0.1);
	color: var(--accent-400);
}

.hero__trust-icon svg {
	width: 18px;
	height: 18px;
}

.hero__trust-text {
	font-size: var(--fs-body);
	line-height: 1.3;
	color: var(--text-secondary);
}

@keyframes hero-rise {
	from {
		opacity: 0;
		transform: translateY(14px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ==========================================================================
   Hero scene — dashboard + floating bureau cards
   ========================================================================== */

.hero__visual {
	position: relative;
}

.hero-scene {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--space-lg);
	opacity: 0;
	animation: hero-rise var(--transition-slow) 320ms forwards;
}

.hero-scene__glow {
	position: absolute;
	inset: -15%;
	z-index: 0;
	background: radial-gradient(circle at 60% 35%, var(--accent-glow) 0%, rgba(47, 111, 255, 0) 60%);
	opacity: 0.6;
	pointer-events: none;
}

/* Middle layer: a dark tilted surface the dashboard visually sits in front
   of, giving the scene a second plane instead of one flat card. Desktop
   only — there's no room for a background plane once everything stacks. */
.hero-scene__backdrop {
	display: none;
}

/* Bottom layer: a soft ground-glow the whole composition rests on. */
.hero-scene__ground {
	position: absolute;
	left: 8%;
	right: 8%;
	bottom: -6%;
	height: 22%;
	z-index: 0;
	background: radial-gradient(ellipse, rgba(47, 111, 255, 0.28) 0%, rgba(47, 111, 255, 0) 72%);
	filter: blur(24px);
	pointer-events: none;
}

/* Small foreground UI accents, floating just outside the dashboard's own
   edges — decorative, never over its title or chart. */
.hero-scene__badge {
	display: none;
}

/* ---- Bureau cards ---- */

.hero-bureaus {
	position: relative;
	z-index: 2;
	display: grid;
	/* minmax(0, 1fr) — see .hero__inner for why a bare 1fr blows out here
	   too once a card's content (e.g. "TransUnion") needs more than an
	   even third. */
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--space-sm);
	width: 100%;
	max-width: 520px;
}

.bureau-card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--space-2xs);
	padding: var(--space-sm);
	background: var(--surface-elevated);
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-md);
	text-align: left;
}

.bureau-card__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	flex-shrink: 0;
	border-radius: 50%;
	background: rgba(47, 111, 255, 0.14);
	color: var(--accent-300);
	font-size: 0.6875rem;
	font-weight: var(--fw-bold);
}

.bureau-card__body {
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
	min-width: 0;
}

.bureau-card__name {
	font-size: 0.75rem;
	font-weight: var(--fw-semibold);
	color: var(--text-primary);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.bureau-card__status {
	font-size: 0.6875rem;
	color: var(--text-tertiary);
	white-space: nowrap;
}

/* ---- Main dashboard panel ---- */

.hero-dashboard {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 460px;
	background: linear-gradient(165deg, var(--surface-elevated), var(--surface) 60%);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-lg), var(--shadow-glow);
	padding: var(--space-lg);
	animation: dashboard-float 7s ease-in-out infinite;
}

@keyframes dashboard-float {
	0%,
	100% {
		transform: translateY(0);
	}
	50% {
		transform: translateY(-10px);
	}
}

.hero-dashboard__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	margin-bottom: var(--space-lg);
}

.hero-dashboard__title {
	font-size: var(--fs-h3);
	font-weight: var(--fw-semibold);
	color: var(--text-primary);
}

.hero-dashboard__badge {
	display: inline-flex;
	align-items: center;
	gap: var(--space-3xs);
	font-size: 0.6875rem;
	font-weight: var(--fw-medium);
	color: var(--text-secondary);
	border: 1px solid var(--border);
	border-radius: var(--radius-full);
	padding: 0.3125rem 0.75rem;
	white-space: nowrap;
}

.hero-dashboard__badge::before {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #34d399;
	box-shadow: 0 0 8px 1px rgba(52, 211, 153, 0.6);
}

/* ---- Stat row: process ring + two tiles ---- */

.hero-dashboard__stats {
	display: flex;
	align-items: stretch;
	gap: var(--space-sm);
	margin-bottom: var(--space-lg);
}

.stat-ring {
	position: relative;
	flex-shrink: 0;
	width: 88px;
	height: 88px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.stat-ring svg {
	width: 100%;
	height: 100%;
	transform: rotate(-90deg);
}

.stat-ring__track {
	fill: none;
	stroke: var(--border);
	stroke-width: 5;
}

.stat-ring__indicator {
	fill: none;
	stroke: url(#ring-gradient);
	stroke-width: 5;
	stroke-linecap: round;
	stroke-dasharray: 58 175;
	transform-box: fill-box;
	transform-origin: 50% 50%;
	animation: ring-rotate 1.8s linear infinite;
}

@keyframes ring-rotate {
	to {
		transform: rotate(360deg);
	}
}

.stat-ring__icon {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--accent-300);
}

.hero-dashboard__tiles {
	flex: 1;
	min-width: 0;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: var(--space-xs);
}

.stat-tile {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 0.25rem;
	padding: var(--space-xs) var(--space-sm);
	background: rgba(255, 255, 255, 0.02);
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	min-width: 0;
}

.stat-tile__label {
	font-size: 0.6875rem;
	color: var(--text-secondary);
	line-height: 1.3;
}

.stat-tile__value {
	font-size: var(--fs-body);
	font-weight: var(--fw-semibold);
	color: var(--text-primary);
}

.stat-tile__value--review {
	color: #fbd66b;
}

.stat-tile__value--updated {
	color: #6ee7b7;
}

.hero-dashboard__ring-caption {
	position: absolute;
	bottom: -1.35rem;
	left: 50%;
	transform: translateX(-50%);
	font-size: 0.5625rem;
	color: var(--text-tertiary);
	white-space: nowrap;
}

/* ---- Chart ---- */

.hero-dashboard__chart {
	margin-bottom: var(--space-lg);
}

.hero-dashboard__chart-label {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	font-size: var(--fs-body-sm);
	color: var(--text-secondary);
	margin-bottom: var(--space-sm);
}

.hero-dashboard__chart-label span:last-child {
	font-size: 0.6875rem;
	color: var(--text-tertiary);
}

.hero-dashboard__chart svg {
	width: 100%;
	height: auto;
	overflow: visible;
}

.hero-dashboard__chart-line {
	fill: none;
	stroke: var(--accent-400);
	stroke-width: 3;
	stroke-linecap: round;
	stroke-linejoin: round;
	filter: drop-shadow(0 0 6px var(--accent-glow));
	transition: stroke-dashoffset 1.8s 700ms cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-dashboard__chart-fill {
	opacity: 0;
	animation: chart-fade 1s 1.4s ease forwards;
}

.hero-dashboard__chart-dot {
	fill: var(--bg-primary);
	stroke: var(--accent-400);
	stroke-width: 2;
	opacity: 0;
	animation: chart-fade 0.6s 1.9s ease forwards;
}

@keyframes chart-fade {
	to {
		opacity: 1;
	}
}

.hero-dashboard__chart-axis {
	display: flex;
	justify-content: space-between;
	margin-top: var(--space-xs);
}

.hero-dashboard__chart-axis span {
	font-size: 0.625rem;
	color: var(--text-tertiary);
}

.hero-dashboard__disclaimer {
	font-size: 0.6875rem;
	line-height: 1.5;
	color: var(--text-tertiary);
	text-align: center;
}

@media (prefers-reduced-motion: reduce) {
	.stat-ring__indicator {
		animation: none;
	}
}

@media (min-width: 560px) {
	.hero-bureaus,
	.hero-dashboard {
		max-width: 500px;
	}
}

@media (min-width: 960px) {
	.hero {
		min-height: 100vh;
		box-sizing: border-box;
		display: flex;
		align-items: center;
		padding-top: calc(var(--header-height) + var(--space-lg));
	}

	.hero__inner {
		grid-template-columns: minmax(0, 1fr) minmax(0, 0.95fr);
		gap: var(--space-xl);
	}

	.hero-scene {
		align-items: flex-end;
		/* The gutter is deliberately smaller than the bureau column's own
		   width — the cards are meant to overlap the dashboard's outer edge
		   for depth (this phase wants layering, unlike the previous pass).
		   The overlap amount stays inside .hero-dashboard's own padding
		   (--space-xl/2xl below), which is verified empty of text in
		   Fase 1.2 QA, so it never sits on top of the title or chart. */
		padding-left: 110px;
	}

	.hero-scene__backdrop {
		display: block;
		position: absolute;
		z-index: 0;
		inset: 4% -4% 6% 34%;
		background: linear-gradient(155deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0) 45%),
			var(--bg-secondary);
		border: 1px solid var(--border);
		border-radius: var(--radius-lg);
		transform: rotate(-3deg);
		box-shadow: var(--shadow-lg);
	}

	.hero-scene__badge {
		display: flex;
		align-items: center;
		gap: var(--space-2xs);
		position: absolute;
		z-index: 3;
		padding: var(--space-xs) var(--space-md);
		background: var(--surface-elevated);
		border: 1px solid var(--border);
		border-radius: var(--radius-full);
		box-shadow: var(--shadow-md);
		font-size: var(--fs-body-sm);
		font-weight: var(--fw-medium);
		color: var(--text-primary);
		white-space: nowrap;
		animation: dashboard-float 8s ease-in-out infinite;
	}

	.hero-scene__badge::before {
		content: "";
		width: 6px;
		height: 6px;
		border-radius: 50%;
		background: var(--accent-500);
		box-shadow: 0 0 10px 2px var(--accent-glow);
	}

	.hero-scene__badge--top {
		top: -4%;
		right: 12%;
		animation-delay: -2s;
	}

	.hero-scene__badge--bottom {
		bottom: 2%;
		left: -6%;
		animation-delay: -5s;
	}

	.hero-bureaus {
		position: absolute;
		left: 0;
		top: 4%;
		z-index: 2;
		grid-template-columns: minmax(0, 1fr);
		width: 150px;
		gap: var(--space-md);
	}

	/* Depth stagger: each card reads as a slightly different plane instead
	   of three identical chips in a row. */
	.bureau-card:nth-child(1) {
		z-index: 3;
	}

	.bureau-card:nth-child(2) {
		z-index: 2;
		transform: translateX(20px) scale(0.97);
		opacity: 0.94;
	}

	.bureau-card:nth-child(3) {
		z-index: 1;
		transform: scale(0.93);
		opacity: 0.86;
	}

	.hero-dashboard {
		max-width: 680px;
		padding: var(--space-xl);
	}

	.stat-ring {
		width: 104px;
		height: 104px;
	}
}

@media (min-width: 1280px) {
	.hero-scene {
		padding-left: 128px;
	}

	.hero-bureaus {
		width: 170px;
	}

	.hero-dashboard {
		max-width: 780px;
	}

	.stat-ring {
		width: 116px;
		height: 116px;
	}
}

@media (min-width: 1600px) {
	.hero__inner {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
		gap: var(--space-2xl);
	}

	.hero-scene {
		padding-left: 148px;
	}

	.hero-scene__backdrop {
		inset: 2% -6% 4% 30%;
	}

	.hero-bureaus {
		width: 190px;
	}

	.hero-dashboard {
		max-width: 860px;
	}

	.stat-ring {
		width: 128px;
		height: 128px;
	}
}

@media (min-width: 1800px) {
	.hero__inner {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr);
	}

	.hero-scene {
		padding-left: 156px;
	}

	.hero-bureaus {
		width: 210px;
	}

	.hero-dashboard {
		max-width: 900px;
		padding: var(--space-2xl);
	}

	.stat-ring {
		width: 136px;
		height: 136px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hero-dashboard,
	.hero-scene__badge {
		animation: none;
	}

	.hero__eyebrow,
	.hero__title span,
	.hero__copy,
	.hero__actions,
	.hero__trust,
	.hero-scene {
		opacity: 1;
		animation: none;
		transform: none;
	}

	.hero-dashboard__chart-fill,
	.hero-dashboard__chart-dot {
		opacity: 1;
		animation: none;
	}
}
