/**
 * JR Modern Blocks — Hero Header
 * Fundo: gradiente animado (paleta) / imagem / vídeo + overlay.
 */

.jr-hero {
	--jr-hero-c1: #000000;
	--jr-hero-c2: #06b6d4;
	--jr-hero-c3: #0891b2;
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	min-height: 100vh;
	/* Largura total do viewport por defeito (o controlo "Largura" pode alterar).
	   margin-left 50% + translateX(-50%) mantém o bloco centrado no viewport
	   seja qual for a largura, sem depender da largura do contentor pai. */
	width: 100vw;
	max-width: 100vw;
	margin-left: 50%;
	transform: translateX(-50%);
	padding: 64px 24px;
	overflow: hidden;
	isolation: isolate;
}

/* ---- Camada de fundo ---- */
.jr-hero__bg {
	position: absolute;
	inset: 0;
	z-index: -2;
}

.jr-hero__canvas,
.jr-hero__bg--gradient,
.jr-hero__img,
.jr-hero__video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: block;
}

/* Canvas do shader WebGL: fica por cima do gradiente CSS (fallback). Se o
   WebGL falhar, o JS remove o canvas e o gradiente CSS volta a aparecer. */
.jr-hero__canvas {
	z-index: 1;
}

.jr-hero__img,
.jr-hero__video {
	object-fit: cover;
}

.jr-hero__bg--gradient {
	background: linear-gradient(
		130deg,
		var(--jr-hero-c1),
		var(--jr-hero-c2),
		var(--jr-hero-c3),
		var(--jr-hero-c2)
	);
	background-size: 300% 300%;
	background-position: 0% 50%;
}

.jr-hero--grad-animate .jr-hero__bg--gradient {
	animation: jr-hero-gradient 16s ease infinite;
}

@keyframes jr-hero-gradient {
	0% {
		background-position: 0% 50%;
	}
	50% {
		background-position: 100% 50%;
	}
	100% {
		background-position: 0% 50%;
	}
}

.jr-hero__overlay {
	position: absolute;
	inset: 0;
	background-color: rgba(0, 0, 0, 0.35);
}

/* ---- Conteúdo ---- */
.jr-hero__inner {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	max-width: 720px;
	width: 100%;
	text-align: center;
}

.jr-hero__subtitle {
	margin: 0 0 12px;
	font-size: 0.95rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.8);
}

.jr-hero__title {
	margin: 0 0 20px;
	font-size: clamp(2.25rem, 5vw, 4rem);
	font-weight: 800;
	line-height: 1.05;
	color: #fff;
}

.jr-hero__description {
	margin: 0 auto 32px;
	max-width: 60ch;
	font-size: 1.1rem;
	line-height: 1.6;
	color: rgba(255, 255, 255, 0.85);
}

/* ---- Botões ---- */
.jr-hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	justify-content: center;
}

.jr-hero__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 14px 28px;
	border-radius: 999px;
	font-weight: 600;
	text-decoration: none;
	line-height: 1;
	transition: background-color 200ms ease, color 200ms ease, transform 200ms ease;
}

.jr-hero__btn:hover {
	transform: translateY(-2px);
}

.jr-hero__btn--primary {
	background: #fff;
	color: #111;
}

.jr-hero__btn--secondary {
	background: transparent;
	color: #fff;
	border: 1px solid rgba(255, 255, 255, 0.6);
}

/* ---- Animação de entrada ---- */
.jr-hero--animate .jr-hero__inner > * {
	opacity: 0;
	transform: translateY(24px);
	animation: jr-hero-in 700ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.jr-hero--animate .jr-hero__subtitle {
	animation-delay: 80ms;
}

.jr-hero--animate .jr-hero__title {
	animation-delay: 180ms;
}

.jr-hero--animate .jr-hero__description {
	animation-delay: 300ms;
}

.jr-hero--animate .jr-hero__actions {
	animation-delay: 420ms;
}

@keyframes jr-hero-in {
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.jr-hero--grad-animate .jr-hero__bg--gradient {
		animation: none;
	}
	.jr-hero--animate .jr-hero__inner > * {
		opacity: 1;
		transform: none;
		animation: none;
	}
}
