/**
 * Beauvit — hero component (home).
 *
 * Full-bleed premium hero: attachment-ID-39 product photo under a warm dark
 * scrim, with a floating "formula constellation" (amber orbs, orbital rings,
 * capsule shapes and drifting particles) that echoes "формулы нового поколения".
 * A transparent glass header floats over the top of this section.
 *
 * @package Beauvit
 */

.hero {
	position: relative;
	isolation: isolate;
	min-height: 92vh;
	min-height: 100svh;
	display: flex;
	overflow: hidden;
	/* Fallback background when attachment 39 is unavailable — the hero never
	   collapses to a flat black block. */
	background:
		radial-gradient(75% 60% at 78% 22%, rgba(220, 159, 82, 0.28) 0%, transparent 60%),
		radial-gradient(90% 80% at 20% 90%, rgba(120, 60, 22, 0.35) 0%, transparent 60%),
		linear-gradient(155deg, #1a120a 0%, #0c0805 100%);
}

/* Layer 1 — the product photograph (set inline from wp_get_attachment_image_url). */
.hero__media {
	position: absolute;
	inset: 0;
	z-index: 0;
	background-position: center;
	background-size: cover;
	background-repeat: no-repeat;
	/* Slight overscale so the mouse-parallax offset never reveals a hard edge. */
	transform:
		scale(1.06)
		translate3d(calc(var(--bv-px, 0) * -8px), calc(var(--bv-py, 0) * -8px), 0);
	transition: transform 0.5s ease-out;
	will-change: transform;
}

/* Layer 2 — the legibility scrim. Darkest at the very top (for the floating
   header) and along the lower-left (where the copy sits); the upper-right stays
   clearer so the jars remain the visual hero. */
.hero__scrim {
	position: absolute;
	inset: 0;
	z-index: 1;
	background:
		linear-gradient(180deg, rgba(10, 7, 4, 0.72) 0%, rgba(10, 7, 4, 0.12) 26%, rgba(10, 7, 4, 0.2) 55%, rgba(10, 7, 4, 0.82) 100%),
		radial-gradient(120% 95% at 8% 96%, rgba(9, 6, 3, 0.82) 0%, transparent 60%),
		radial-gradient(70% 60% at 88% 30%, rgba(220, 159, 82, 0.14) 0%, transparent 62%);
}

/* Layer 3 — floating decorative "formula" objects. Behind the copy, never
   interactive. Mouse-parallax is applied to this whole layer; each child runs
   its own slow ambient animation so the transforms never fight. */
.hero__decor {
	position: absolute;
	inset: -6%;
	z-index: 2;
	pointer-events: none;
	transform: translate3d(calc(var(--bv-px, 0) * 20px), calc(var(--bv-py, 0) * 20px), 0);
	transition: transform 0.4s ease-out;
	will-change: transform;
}

.hero__decor span,
.hero__decor .orbit,
.hero__decor .capsule,
.hero__decor .botanical {
	position: absolute;
	display: block;
}

/* Amber glowing spheres --------------------------------------------- */
.orb {
	border-radius: 50%;
	filter: blur(1px);
	background: radial-gradient(circle at 32% 28%, rgba(255, 226, 176, 0.95), rgba(220, 159, 82, 0.55) 42%, rgba(150, 80, 28, 0) 72%);
	box-shadow: 0 0 42px 6px rgba(220, 159, 82, 0.28);
	animation: bv-float 16s var(--bv-ease) infinite;
}

.orb--1 { width: 190px; height: 190px; top: 14%; right: 12%; opacity: 0.85; animation-duration: 19s; }
.orb--2 { width: 90px;  height: 90px;  top: 62%; right: 26%; opacity: 0.7;  animation-duration: 14s; animation-delay: -4s; }
.orb--3 { width: 46px;  height: 46px;  top: 34%; left: 18%;  opacity: 0.75; animation-duration: 12s; animation-delay: -7s; }
.orb--4 { width: 260px; height: 260px; bottom: -6%; left: -4%; opacity: 0.4; filter: blur(6px); animation-duration: 24s; }

/* Thin orbital rings ------------------------------------------------ */
.orbit {
	border: 1px solid rgba(240, 208, 150, 0.28);
	border-radius: 50%;
	animation: bv-spin 44s linear infinite;
}

.orbit::after {
	/* a small satellite bead riding the ring */
	content: "";
	position: absolute;
	top: -4px;
	left: 50%;
	width: 8px;
	height: 8px;
	margin-left: -4px;
	border-radius: 50%;
	background: var(--bv-accent-strong, #f2c581);
	box-shadow: 0 0 14px 2px rgba(220, 159, 82, 0.7);
}

.orbit--1 { width: 340px; height: 340px; top: 10%; right: 6%; opacity: 0.5; }
.orbit--2 { width: 520px; height: 220px; top: 30%; right: -6%; opacity: 0.28; transform: rotate(-18deg); animation-duration: 60s; animation-direction: reverse; }
.orbit--3 { width: 180px; height: 180px; bottom: 12%; left: 8%; opacity: 0.35; animation-duration: 36s; }

/* Capsule / pill decorative shapes ---------------------------------- */
.capsule {
	width: 70px;
	height: 26px;
	border-radius: 999px;
	background: linear-gradient(90deg, rgba(255, 232, 194, 0.9) 0 50%, rgba(220, 159, 82, 0.85) 50% 100%);
	box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.25);
	opacity: 0.9;
	animation: bv-tumble 18s var(--bv-ease) infinite;
}

.capsule--1 { top: 22%; left: 26%; transform: rotate(28deg); animation-delay: -3s; }
.capsule--2 { bottom: 20%; right: 18%; width: 54px; height: 20px; transform: rotate(-16deg); opacity: 0.75; animation-duration: 22s; animation-delay: -9s; }
.capsule--3 { top: 70%; left: 12%; width: 40px; height: 15px; transform: rotate(52deg); opacity: 0.6; animation-duration: 15s; }

/* Faint botanical / mineral silhouette ------------------------------ */
.botanical {
	width: 220px;
	height: 220px;
	top: 8%;
	left: 4%;
	color: rgba(240, 208, 150, 0.14);
	animation: bv-sway 20s var(--bv-ease) infinite;
}

.botanical svg {
	width: 100%;
	height: 100%;
	display: block;
}

.botanical--2 {
	width: 150px;
	height: 150px;
	top: auto;
	left: auto;
	bottom: 6%;
	right: 8%;
	color: rgba(240, 208, 150, 0.1);
	animation-duration: 26s;
	animation-delay: -6s;
}

/* Drifting light particles ------------------------------------------ */
.particle {
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: rgba(255, 231, 189, 0.9);
	box-shadow: 0 0 10px 2px rgba(220, 159, 82, 0.55);
	opacity: 0;
	animation: bv-rise linear infinite;
}

/* Layer 4 — the copy. -------------------------------------------------- */
.hero__inner {
	position: relative;
	z-index: 3;
	align-self: stretch;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	/* Clear the floating header at the top, breathe at the bottom. */
	padding-top: clamp(6.5rem, 16vh, 10rem);
	padding-bottom: clamp(2.5rem, 8vh, 5rem);
}

.hero__content {
	max-width: 44rem;
}

.hero__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 0.65rem;
	margin: 0 0 1.4rem;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.24em;
	text-transform: uppercase;
	color: var(--bv-accent-strong);
}

.hero__eyebrow::before {
	content: "";
	width: 34px;
	height: 1px;
	background: linear-gradient(90deg, var(--bv-accent-strong), transparent);
}

.hero__title {
	font-size: clamp(2.5rem, 6.4vw, 5rem);
	font-weight: 500;
	line-height: 1.04;
	letter-spacing: -0.02em;
	margin: 0 0 1.4rem;
	color: #fdf7ec;
	text-shadow: 0 2px 30px rgba(0, 0, 0, 0.55);
}

.hero__title em {
	font-style: italic;
	font-weight: 500;
	color: var(--bv-accent-strong);
	background: linear-gradient(90deg, #f6cf8e, #dc9f52);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}

.hero__subtitle {
	max-width: 46ch;
	margin: 0 0 2.4rem;
	font-size: clamp(1.05rem, 2.1vw, 1.28rem);
	line-height: 1.6;
	color: #e7ddcd;
	text-shadow: 0 1px 18px rgba(0, 0, 0, 0.5);
}

.hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.9rem;
	margin-bottom: 2.6rem;
}

.hero__actions .button--ghost {
	color: #f5ede1;
	border-color: rgba(245, 237, 225, 0.4);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	background: rgba(255, 255, 255, 0.04);
}

.hero__actions .button--ghost:hover {
	border-color: var(--bv-accent);
	color: #fff;
}

.hero__badges {
	max-width: 40rem;
}

/* Scroll cue --------------------------------------------------------- */
.hero__scroll {
	position: absolute;
	z-index: 3;
	left: 50%;
	bottom: 1.3rem;
	transform: translateX(-50%);
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.66rem;
	font-weight: 700;
	letter-spacing: 0.24em;
	text-transform: uppercase;
	color: rgba(245, 237, 225, 0.6);
}

.hero__scroll-line {
	width: 1px;
	height: 40px;
	background: linear-gradient(180deg, rgba(240, 208, 150, 0.7), transparent);
	animation: bv-cue 2.4s var(--bv-ease) infinite;
	transform-origin: top;
}

/* -------------------------------------------------------------------- */
/* Keyframes                                                            */
/* -------------------------------------------------------------------- */
@keyframes bv-float {
	0%, 100% { transform: translate3d(0, 0, 0); }
	50%      { transform: translate3d(0, -26px, 0); }
}

@keyframes bv-tumble {
	0%   { transform: translate3d(0, 0, 0) rotate(var(--r, 0deg)); }
	50%  { transform: translate3d(14px, -22px, 0) rotate(calc(var(--r, 0deg) + 16deg)); }
	100% { transform: translate3d(0, 0, 0) rotate(var(--r, 0deg)); }
}

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

@keyframes bv-sway {
	0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
	50%      { transform: translate3d(0, -18px, 0) rotate(6deg); }
}

@keyframes bv-rise {
	0%   { transform: translate3d(0, 0, 0); opacity: 0; }
	12%  { opacity: 0.9; }
	85%  { opacity: 0.55; }
	100% { transform: translate3d(24px, -120px, 0); opacity: 0; }
}

@keyframes bv-cue {
	0%, 100% { transform: scaleY(0.4); opacity: 0.4; }
	50%      { transform: scaleY(1);   opacity: 1; }
}

/* Capsule rotation is baked into per-element transform; keep it stable by
   feeding the base rotation into the keyframe via a custom property. */
.capsule--1 { --r: 28deg; }
.capsule--2 { --r: -16deg; }
.capsule--3 { --r: 52deg; }

/* -------------------------------------------------------------------- */
/* Responsive                                                           */
/* -------------------------------------------------------------------- */
@media (max-width: 820px) {
	.hero__title { font-size: clamp(2.3rem, 9vw, 3.4rem); }

	.orbit--2 { display: none; }
	.orb--4 { opacity: 0.28; }
	.botanical { opacity: 0.7; }
}

@media (max-width: 560px) {
	.hero { min-height: 90svh; }

	.hero__inner {
		padding-top: clamp(5.5rem, 22vh, 8rem);
	}

	.hero__subtitle { font-size: 1.02rem; }

	.hero__actions .button {
		flex: 1 1 auto;
	}

	/* Trim the busiest decor on small screens so it never crowds the copy. */
	.orb--3,
	.capsule--3,
	.botanical--2 { display: none; }

	.orb--1 { width: 130px; height: 130px; }
	.orbit--1 { width: 240px; height: 240px; }
}

/* Freeze the constellation for reduced-motion users (main.css also caps
   animation duration globally — this keeps the composition tasteful). */
@media (prefers-reduced-motion: reduce) {
	.hero__media { transform: scale(1.02); }
	.hero__decor { transform: none; }
	.particle { display: none; }
	.hero__scroll-line { animation: none; }
}
