/* NIIC hero — замена Slider Revolution «Slider 1» (сетка 1170×450, fullwidth).
   Координаты слоёв взяты из Revolution 1:1. На ширине 768–1169 сцена
   пропорционально масштабируется (--s задаёт hero.js), ниже 768 — колонка. */

.niic-hero {
	/* масштаб без JS: 100vw / 1170px как число (tan(atan2) — трюк для деления длин) */
	--s: min(1, tan(atan2(100vw, 1170px)));
	--niic-navy: #00275e;
	--niic-red: #e42528;
	--ease: cubic-bezier(.215, .61, .355, 1); /* power3.out */
	position: relative;
	overflow: hidden;
	height: calc(450px * var(--s));
	background: var(--niic-navy) var(--niic-hero-bg, none) right center / cover no-repeat;
	color: #fff;
}

.niic-hero__stage {
	position: absolute;
	top: 0;
	left: 50%;
	width: 1170px;
	height: 450px;
	transform: translateX(-50%) scale(var(--s));
	transform-origin: 50% 0;
}

.niic-hero__grid {
	position: absolute;
	inset: 0;
}

/* Фотографии справа */
.niic-hero__media { position: absolute; inset: 0; }
.niic-hero .niic-hero__img {
	position: absolute;
	display: block;
	max-width: none;
	height: auto;
	object-fit: cover;
	margin: 0;
}
.niic-hero .niic-hero__img--a { left: 559px; top: -4px;  width: 756px; height: 460px; z-index: 8; }
.niic-hero .niic-hero__img--b { left: 518px; top: -29px; width: 817px; height: 497px; z-index: 9; opacity: 0; }

/* Синяя панель слева (перекрывает левый край фотографий, как в Revolution) */
.niic-hero__panel {
	position: absolute;
	left: -187px;
	top: -25px;
	width: 756px;
	height: 535px;
	background: var(--niic-navy);
	z-index: 10;
}

.niic-hero__content { position: absolute; inset: 0; z-index: 11; }

.niic-hero .niic-hero__kicker {
	position: absolute;
	left: 44px;
	top: 97px;
	margin: 0;
	padding: 0;
	font: 500 24px/22px Arial, Helvetica, sans-serif;
	letter-spacing: 12px;
	text-transform: uppercase;
	color: #fff;
	white-space: nowrap;
}
.niic-hero__kicker > span { display: inline-block; }
.niic-hero__line {
	position: absolute;
	left: 191px; /* 235 − 44 */
	top: 8px;    /* 105 − 97 */
	width: 156px;
	height: 1px;
	background: var(--niic-red);
}

.niic-hero .niic-hero__title {
	position: absolute;
	left: 43px;
	top: 151px;
	width: 748px;
	margin: 0;
	padding: 0;
	overflow: hidden;
	/* !important: тема (skin-custom.css) задаёт h1 размеры с !important на узких экранах */
	font-family: 'Arial Black', Gadget, Arial, sans-serif !important;
	font-weight: 900 !important;
	font-size: 46px !important;
	line-height: 52px !important;
	letter-spacing: -1px !important;
	text-transform: none !important;
	color: #fff;
	text-shadow: 3px 3px 0 rgba(0, 0, 0, .55);
}
.niic-hero .niic-hero__title::before,
.niic-hero .niic-hero__title::after { display: none !important; }
.niic-hero__title > span { display: block; padding-bottom: 4px; }

.niic-hero .niic-hero__subtitle {
	position: absolute;
	left: 45px;
	top: 261px;
	margin: 0;
	padding: 0;
	font: 400 20px/25px Arial, Helvetica, sans-serif;
	color: #fff;
	white-space: nowrap;
}

.niic-hero .niic-hero__btn {
	position: absolute;
	left: 69px;
	top: 335px;
	display: inline-block;
	padding: 5px 30px;
	background: var(--niic-red);
	color: #fff;
	font: 500 15px/32px Arial, Helvetica, sans-serif;
	text-decoration: none;
	transform: skew(-32deg);
	transition: filter .3s;
}
.niic-hero__btn > span { display: inline-block; transform: skew(32deg); }
.niic-hero .niic-hero__btn:hover,
.niic-hero .niic-hero__btn:focus-visible { color: #fff; filter: brightness(120%); }
.niic-hero .niic-hero__btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* ---------- Анимация появления (как тайминги слоёв Revolution) ---------- */
.niic-hero.is-ready .niic-hero__img--a    { animation: niic-fade 1s var(--ease) both; }
.niic-hero.is-ready .niic-hero__img--b    { animation: niic-swap 25s linear infinite; }
.niic-hero.is-ready .niic-hero__title > span { animation: niic-rise 1.5s var(--ease) .5s both; }
.niic-hero.is-ready .niic-hero__kicker > span { animation: niic-drop 1.5s var(--ease) .7s both; }
.niic-hero.is-ready .niic-hero__line      { animation: niic-slide 1.5s var(--ease) .9s both; }
.niic-hero.is-ready .niic-hero__btn       { animation: niic-from-left 1s var(--ease) 1.4s both; }
.niic-hero.is-ready .niic-hero__subtitle  { animation: niic-fade .51s var(--ease) 1.61s both; }

@keyframes niic-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes niic-rise { from { transform: translateY(100%); } to { transform: none; } }
@keyframes niic-drop { from { opacity: 0; transform: translateY(-50px); } to { opacity: 1; transform: none; } }
@keyframes niic-slide { from { opacity: 0; transform: translateX(-50px); } to { opacity: 1; transform: none; } }
@keyframes niic-from-left {
	from { opacity: 0; transform: translateX(-250px) skew(-32deg); }
	to   { opacity: 1; transform: skew(-32deg); }
}
/* Вторая фотография: появляется на 11,9 с (1,2 с), исчезает на 22,9 с (2,1 с), цикл 25 с */
@keyframes niic-swap {
	0%, 47.6% { opacity: 0; }
	52.5%, 91.7% { opacity: 1; }
	100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.niic-hero.is-ready * { animation: none !important; }
}

/* ---------- Телефон: колонка (фото сверху, текст на синем) ---------- */
@media (max-width: 767px) {
	.niic-hero { --s: 1; height: auto; background-image: none; }
	.niic-hero__stage,
	.niic-hero__grid,
	.niic-hero__content { position: static; width: auto; height: auto; transform: none; }
	.niic-hero__panel { display: none; }
	.niic-hero__media { position: relative; aspect-ratio: 1314 / 800; }
	.niic-hero .niic-hero__img--a,
	.niic-hero .niic-hero__img--b { left: 0; top: 0; width: 100%; height: 100%; }
	.niic-hero__content { padding: 28px 24px 36px; }
	.niic-hero .niic-hero__kicker,
	.niic-hero .niic-hero__title,
	.niic-hero .niic-hero__subtitle,
	.niic-hero .niic-hero__btn { position: relative; left: auto; top: auto; }
	.niic-hero .niic-hero__kicker { font-size: 16px; letter-spacing: 7px; }
	.niic-hero__line { left: auto; right: auto; position: relative; display: inline-block; top: -4px; width: 60px; margin-left: 12px; }
	.niic-hero .niic-hero__title { width: auto; margin-top: 18px; font-size: 28px !important; line-height: 34px !important; }
	.niic-hero .niic-hero__subtitle { margin-top: 10px; white-space: normal; font-size: 16px; line-height: 22px; }
	.niic-hero .niic-hero__btn { margin: 24px 0 0 14px; }
}
