/* ============================================================
   VETOSEC cinematic hero — live Lottie space scene.
   Monochrome while the hero is dominant; the original navbar
   and brand colour return once the hero recedes past ~50%.
   Parallax and load-in run on transform / opacity only.
   ============================================================ */

/* --- The stage -------------------------------------------------- */

/* `section#hero` specificity beats home.css's legacy `section#hero` rules. */
section#hero.hero-cinema {
	position: relative;
	width: 100%;
	/* body.home main drops the fixed-nav padding, so the hero simply spans
	   the full viewport behind the transparent nav and ends at the fold. */
	height: 100svh;
	min-height: 520px;
	overflow: hidden;
	padding: 0;
	margin-top: 0;
	background: #000;
	isolation: isolate;
	z-index: 1;
}

/* Neutralise the legacy home.css `section#hero h1 / p / .btn` styling so the
   cinematic title card keeps its own editorial treatment. */
section#hero.hero-cinema h1,
section#hero.hero-cinema p { color: inherit; margin: 0; }
section#hero.hero-cinema .btn { min-width: 0; }

.cinema-stage {
	position: absolute;
	inset: 0;
	overflow: hidden;
	contain: strict;
	z-index: 0;
}

.cinema-void {
	position: absolute;
	inset: 0;
	background:
		radial-gradient(ellipse 120% 100% at 50% 38%, #161b21 0%, #080b0e 48%, #010203 100%);
	z-index: 0;
}

.cinema-lottie {
	position: absolute;
	inset: -6%;
	width: 112%;
	height: 112%;
	z-index: 1;
	contain: layout paint;
	will-change: transform;
	/* Slight overscan so parallax shift never reveals an edge.
	   --cinema-p (0..1) is set by cinema-hero.js on the hero section and
	   inherited here; the background recedes (translates down) so it
	   lags the page. */
	transform: translate3d(0, calc(var(--cinema-p, 0) * 22px), 0);
}

.cinema-lottie svg {
	width: 100%;
	height: 100%;
	display: block;
}

/* Static poster: a calm, premium starfield shown before the Lottie
   decodes and as the reduced-motion fallback. Derived from the same
   monochrome grammar, never colourful. */
.cinema-poster {
	position: absolute;
	inset: 0;
	z-index: 2;
	opacity: 1;
	transition: opacity 0.8s ease;
	background:
		radial-gradient(1.5px 1.5px at 12% 18%, rgba(255,255,255,0.85), transparent 60%),
		radial-gradient(1.5px 1.5px at 28% 62%, rgba(255,255,255,0.55), transparent 60%),
		radial-gradient(1px 1px at 41% 28%, rgba(255,255,255,0.7), transparent 60%),
		radial-gradient(2px 2px at 58% 14%, rgba(255,255,255,0.9), transparent 60%),
		radial-gradient(1px 1px at 67% 71%, rgba(255,255,255,0.5), transparent 60%),
		radial-gradient(1.5px 1.5px at 79% 33%, rgba(255,255,255,0.75), transparent 60%),
		radial-gradient(1px 1px at 88% 58%, rgba(255,255,255,0.45), transparent 60%),
		radial-gradient(1.5px 1.5px at 19% 84%, rgba(255,255,255,0.6), transparent 60%),
		radial-gradient(1px 1px at 50% 50%, rgba(255,255,255,0.35), transparent 60%),
		radial-gradient(1px 1px at 73% 88%, rgba(255,255,255,0.4), transparent 60%),
		radial-gradient(ellipse 130% 90% at 50% 42%, #0a0a0f 0%, #050507 65%, #000 100%);
}

.cinema-lottie[data-cinema-ready] .cinema-poster {
	opacity: 0;
	pointer-events: none;
}

.cinema-vignette {
	position: absolute;
	inset: 0;
	z-index: 3;
	pointer-events: none;
	background:
		radial-gradient(ellipse 70% 60% at 50% 50%,
			transparent 0%,
			transparent 38%,
			rgba(0,0,0,0.45) 78%,
			rgba(0,0,0,0.82) 100%);
}

.cinema-grain {
	position: absolute;
	inset: 0;
	z-index: 4;
	pointer-events: none;
	opacity: 0.05;
	mix-blend-mode: overlay;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --- Glitch overlay (CSS-driven, JS-triggered) ----------------- */
/* Sits above the Lottie and vignette, below the branding. Each child
   is a separate glitch channel that the JS scheduler toggles for very
   short durations. All use transform/opacity only. */

.cinema-glitch-overlay {
	position: absolute;
	inset: 0;
	z-index: 5;
	pointer-events: none;
	overflow: hidden;
}

/* Frame tear — a horizontal band that jumps left/right. Multiple
   instances are generated by JS with random top/height/offset. */
.cinema-tear {
	position: absolute;
	left: 0;
	width: 100%;
	height: 0;
	top: 50%;
	background: rgba(255, 255, 255, 0);
	transform: translateX(0);
	mix-blend-mode: screen;
}

/* Scanline desync — thin horizontal lines at random positions. */
.cinema-scanlines {
	position: absolute;
	inset: 0;
	opacity: 0;
	background: repeating-linear-gradient(
		to bottom,
		transparent 0px,
		transparent 3px,
		rgba(255, 255, 255, 0.12) 3px,
		rgba(255, 255, 255, 0.12) 4px
	);
	mix-blend-mode: screen;
}

/* Block corruption — small rectangular regions. Generated by JS as
   child divs with random position/size/opacity. */
.cinema-blocks {
	position: absolute;
	inset: 0;
	opacity: 0;
}

/* White flash — brief full-frame luminance spike. */
.cinema-flash {
	position: absolute;
	inset: 0;
	background: #fff;
	opacity: 0;
	mix-blend-mode: screen;
}

/* System text — tiny monospace fragment that flashes for <300ms. */
.cinema-sys-text {
	position: absolute;
	left: 50%;
	top: 42%;
	transform: translate(-50%, -50%);
	z-index: 7;
	font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
	font-size: 0.65rem;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: rgba(74, 222, 128, 0.85);
	opacity: 0;
	white-space: nowrap;
	pointer-events: none;
}

/* Glitch state classes — applied by cinema-hero.js */
.hero-cinema[data-glitch="1"] .cinema-scanlines { opacity: 0.5; }
.hero-cinema[data-glitch="1"] .cinema-content { animation: cinema-jitter-1 0.1s steps(1) 1; }

.hero-cinema[data-glitch="2"] .cinema-scanlines { opacity: 0.7; }
.hero-cinema[data-glitch="2"] .cinema-blocks { opacity: 1; }
.hero-cinema[data-glitch="2"] .cinema-content { animation: cinema-jitter-2 0.15s steps(1) 1; }

.hero-cinema[data-glitch="3"] .cinema-scanlines { opacity: 0.9; }
.hero-cinema[data-glitch="3"] .cinema-blocks { opacity: 1; }
.hero-cinema[data-glitch="3"] .cinema-flash { opacity: 0.5; }
.hero-cinema[data-glitch="3"] .cinema-content { animation: cinema-jitter-3 0.22s steps(1) 1; }
.hero-cinema[data-glitch="3"] .cinema-lottie { animation: cinema-desync 0.22s steps(1) 1; }

@keyframes cinema-jitter-1 {
	0% { transform: translate3d(0, calc(var(--cinema-p, 0) * -48px), 0); }
	50% { transform: translate3d(3px, calc(var(--cinema-p, 0) * -48px), 0); }
	100% { transform: translate3d(-2px, calc(var(--cinema-p, 0) * -48px), 0); }
}

@keyframes cinema-jitter-2 {
	0% { transform: translate3d(0, calc(var(--cinema-p, 0) * -48px), 0); }
	15% { transform: translate3d(6px, -3px, 0) skewX(-0.5deg); }
	30% { transform: translate3d(-5px, 2px, 0) skewX(0.3deg); }
	50% { transform: translate3d(3px, -1px, 0); }
	70% { transform: translate3d(-2px, 1px, 0); }
	100% { transform: translate3d(0, 0, 0); }
}

@keyframes cinema-jitter-3 {
	0% { transform: translate3d(0, 0, 0); }
	12% { transform: translate3d(10px, -6px, 0) skewX(-1.5deg); }
	25% { transform: translate3d(-8px, 5px, 0) skewX(1deg); }
	37% { transform: translate3d(6px, -3px, 0) skewX(-0.5deg); }
	50% { transform: translate3d(-4px, 2px, 0); }
	65% { transform: translate3d(2px, -1px, 0); }
	80% { transform: translate3d(-1px, 0, 0); }
	100% { transform: translate3d(0, 0, 0); }
}

@keyframes cinema-desync {
	0% { transform: translate3d(0, calc(var(--cinema-p, 0) * 22px), 0); }
	15% { transform: translate3d(-6px, calc(var(--cinema-p, 0) * 22px), 0) scaleY(1.004); }
	30% { transform: translate3d(5px, calc(var(--cinema-p, 0) * 22px), 0); }
	45% { transform: translate3d(-4px, calc(var(--cinema-p, 0) * 22px), 0) scaleY(0.997); }
	60% { transform: translate3d(2px, calc(var(--cinema-p, 0) * 22px), 0); }
	80% { transform: translate3d(-1px, calc(var(--cinema-p, 0) * 22px), 0); }
	100% { transform: translate3d(0, calc(var(--cinema-p, 0) * 22px), 0); }
}

/* Reduced motion: suppress all glitch overlay animation */
@media (prefers-reduced-motion: reduce) {
	.cinema-glitch-overlay,
	.cinema-sys-text { display: none; }
	.hero-cinema[data-glitch] .cinema-content,
	.hero-cinema[data-glitch] .cinema-lottie { animation: none; }
}

/* --- Centered branding ----------------------------------------- */

.cinema-content {
	position: relative;
	z-index: 6;
	height: 100%;
	min-height: 520px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 1.5rem;
	will-change: transform, opacity;
	/* Content drifts up a little faster than the page and fades as the
	   hero recedes. --cinema-p / --cinema-fade are set on the hero section
	   by JS and inherited here. */
	transform: translate3d(0, calc(var(--cinema-p, 0) * -48px), 0);
	opacity: var(--cinema-fade, 1);
}

.cinema-brand {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	max-width: 90vw;
}

.cinema-logo {
	display: block;
	width: clamp(190px, 24vw, 300px);
	height: auto;
	margin: 0 0 1.5rem;
	color: #fff;
	opacity: 0;
	/* Premium load-in: opacity + tiny scale + slight blur resolving sharp. */
	animation: cinema-brand-in 1.1s cubic-bezier(0.4, 0, 0.2, 1) 0.25s forwards;
	filter: blur(6px);
}

.cinema-tagline,
section#hero.hero-cinema .cinema-tagline {
	margin: 0;
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-size: clamp(0.72rem, 1.5vw, 1.02rem);
	font-weight: 500;
	letter-spacing: 0.34em;
	text-transform: uppercase;
	text-wrap: balance;
	color: rgba(255, 255, 255, 0.82);
	opacity: 0;
	animation: cinema-tagline-in 1s cubic-bezier(0.4, 0, 0.2, 1) 0.55s forwards;
}

@keyframes cinema-brand-in {
	0%   { opacity: 0; transform: scale(1.035); filter: blur(6px); }
	100% { opacity: 1; transform: scale(1); filter: blur(0); }
}

@keyframes cinema-tagline-in {
	0%   { opacity: 0; letter-spacing: 0.42em; }
	100% { opacity: 1; letter-spacing: 0.34em; }
}

/* Subtle scroll cue — a single hairline that breathes. */
.cinema-scroll-cue {
	position: absolute;
	left: 50%;
	bottom: clamp(1.5rem, 4vh, 2.8rem);
	transform: translateX(-50%);
	z-index: 6;
	width: 1px;
	height: 46px;
	overflow: hidden;
	opacity: 0.5;
	pointer-events: none;
}

.cinema-scroll-line {
	position: absolute;
	left: 0;
	top: 0;
	width: 1px;
	height: 40%;
	background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.7), transparent);
	animation: cinema-cue 2.4s cubic-bezier(0.4, 0, 0.2, 1) 1.4s infinite;
}

@keyframes cinema-cue {
	0%   { transform: translateY(-100%); }
	60%  { transform: translateY(150%); }
	100% { transform: translateY(150%); }
}

/* --- Navbar monochrome hero state ------------------------------ */
/* Toggled on <html> by cinema-hero.js while the hero is dominant.
   The nav keeps its `dark` base; this overrides it to transparent,
   white, no accents. Removing the class restores the original nav.
   The body background is never overridden — black lives only on the
   hero section itself, so the normal site background shows as soon as
   the hero scrolls away. */

html.cinema-hero-active .topbar {
	transform: translateY(-100%);
	transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	pointer-events: none;
}

/* The topbar is hidden in hero state, so the nav docks to the top. */
html.cinema-hero-active .nav-bar,
html.cinema-hero-active .nav-bar.dark {
	top: 0;
	background: transparent;
	border-bottom-color: transparent;
	box-shadow: none;
}

html.cinema-hero-active .nav-bar::after {
	background: transparent;
}

html.cinema-hero-active .nav-logo img,
html.cinema-hero-active .nav-logo {
	filter: brightness(0) invert(1);
}

html.cinema-hero-active .nav-link,
html.cinema-hero-active .nav-dropdown-toggle {
	color: rgba(255, 255, 255, 0.92);
}

html.cinema-hero-active .nav-link:hover,
html.cinema-hero-active .nav-dropdown-toggle:hover {
	color: #fff;
	background: rgba(255, 255, 255, 0.06);
}

html.cinema-hero-active .nav-link:not(.nav-link-cta):hover::after,
html.cinema-hero-active .nav-link:not(.nav-link-cta):focus-visible::after {
	background: rgba(255, 255, 255, 0.8);
}

html.cinema-hero-active .nav-link--accent {
	color: #fff;
}

html.cinema-hero-active .nav-link-cta {
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.3);
	color: #fff;
}

html.cinema-hero-active .nav-link-cta:hover {
	background: rgba(255, 255, 255, 0.08);
	border-color: rgba(255, 255, 255, 0.55);
	box-shadow: none;
}

html.cinema-hero-active .nav-toggle span {
	background: #fff;
}

html.cinema-hero-active .lang-btn {
	color: rgba(255, 255, 255, 0.6);
}

html.cinema-hero-active .lang-btn.active {
	color: #fff;
}

html.cinema-hero-active .a11y-toggle {
	color: rgba(255, 255, 255, 0.85);
}

html.cinema-hero-active .nav-dropdown-menu {
	background: rgba(0, 0, 0, 0.88);
	border-color: rgba(255, 255, 255, 0.12);
}

html.cinema-hero-active .nav-dropdown-toggle svg {
	color: rgba(255, 255, 255, 0.9);
}

/* Smooth return to the original nav when the hero recedes. */
.nav-bar,
.nav-link,
.nav-link-cta,
.nav-logo img,
.topbar {
	transition: background 0.4s cubic-bezier(0.4, 0, 0.2, 1),
		color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
		border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
		transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
		filter 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reduced motion -------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.cinema-logo,
	.cinema-tagline,
	section#hero.hero-cinema .cinema-tagline {
		opacity: 1;
		animation: none;
		filter: none;
		letter-spacing: 0.34em;
		transform: none;
	}
	.cinema-scroll-cue { display: none; }
	.cinema-lottie { will-change: auto; --cinema-p: 0; transform: none; }
	.cinema-content { --cinema-p: 0; --cinema-fade: 1; transform: none; opacity: 1; }
}

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

@media (max-width: 860px) {
	.hero-cinema, section#hero.hero-cinema { min-height: 480px; }
	.cinema-content { min-height: 480px; }
	.cinema-tagline, section#hero.hero-cinema .cinema-tagline { letter-spacing: 0.26em; }
	.cinema-logo { width: clamp(160px, 48vw, 230px); margin-bottom: 1.1rem; }
	.cinema-scroll-cue { display: none; }
	.cinema-grain { opacity: 0.04; }
}

@media (max-width: 768px) {
	.cinema-tagline, section#hero.hero-cinema .cinema-tagline { font-size: 0.68rem; }
}

/* --- Wide screens ---------------------------------------------- */

@media (min-width: 1700px) {
	.cinema-logo { width: clamp(260px, 18vw, 360px); }
}

/* ============================================================
   Cinema depth layer (cinema-depth.js) — aggressive 3D additions.
   The Lottie scene, entrances and glitch system above stay
   untouched; these rules only add the perspective wrapper and
   the speed-streak canvas.
   ============================================================ */

.cinema-stage {
	perspective: 950px;
}

.cinema-depth-wrap {
	position: absolute;
	inset: 0;
	transform-style: preserve-3d;
	will-change: transform;
}

.cinema-depth {
	position: absolute;
	inset: 0;
	transform-style: preserve-3d;
	will-change: transform;
}

.cinema-streaks {
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
	.cinema-streaks { display: none; }
}

html.a11y-reduce-motion .cinema-streaks,
html.perf-lite .cinema-streaks { display: none; }
