/* RTEX Sections — Services / Projects. Размеры сняты с макета 1392px (1pt = 1px). */
.rx {
	--rx-font: 'Orbitron', sans-serif;
	--rx-gap: 20px;
	--rx-radius: 24px;
	--rx-ease: cubic-bezier(.22, .61, .36, 1);
	position: relative;
	box-sizing: border-box;
	width: 100%;
	background: var(--rx-bg, transparent);
	font-family: var(--rx-font);
	font-weight: 400;
	-webkit-font-smoothing: antialiased;
}
.rx *, .rx *::before, .rx *::after { box-sizing: border-box; }

/* День / ночь: класс ставит RTEX Splash на <html> */
html.theme-day .rx-night-only,
html.theme-night .rx-day-only,
.rx-editor--day .rx-night-only,
.rx-editor--night .rx-day-only { display: none !important; }

/* ---------- Шапка секции ---------- */
.rx .rx-head { margin: 0 0 41px; }
.rx .rx-head__label {
	display: flex; align-items: center; gap: 24px;
	margin: 0; padding-top: 2px; color: var(--rx-label);
	font: 400 18px/1 var(--rx-font); letter-spacing: 0; text-transform: none;
}
.rx .rx-head__line { flex: 0 0 96px; height: 1px; background: currentColor; }
.rx-services { --rx-label: var(--rx-s-label); --rx-head-c: var(--rx-s-head); }
.rx-projects { --rx-label: var(--rx-p-label); --rx-head-c: var(--rx-p-head); }

.rx .rx-head__title {
	margin: 11px -.143em 0 0; padding: 0; /* хвостовой letter-spacing последней буквы не должен переносить строку */
	color: var(--rx-head-c);
	font: 400 clamp(30px, 3.9vw, 56px)/1.25 var(--rx-font);
	letter-spacing: .143em; text-transform: none;
	white-space: nowrap; /* строки — только из админки (Enter); не влезет — JS уменьшит шрифт */
}
.rx .rx-head__sub {
	margin: 14px 0 0; padding: 0;
	color: var(--rx-head-c);
	font: 400 clamp(14px, 1.67vw, 24px)/1.3 var(--rx-font);
	letter-spacing: 0;
}

/* ---------- Номер на фото ---------- */
.rx .rx-num {
	position: absolute; z-index: 2; left: 24px; top: 24px;
	padding-bottom: 5px;
	color: var(--rx-card-text);
	font: 400 16px/1.25 var(--rx-font); letter-spacing: 0;
}
.rx .rx-num::after {
	content: ''; position: absolute; left: 0; bottom: 0;
	width: 32px; height: 1px; background: var(--rx-card-accent);
}

/* ---------- Services ---------- */
.rx-services__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: var(--rx-gap);
}
.rx .rx-scard {
	position: relative; display: block; overflow: hidden;
	aspect-ratio: 333 / 420;
	border-radius: var(--rx-radius);
	background: #0b0b0b;
	color: var(--rx-card-text); text-decoration: none;
	isolation: isolate;
	transform: translateZ(0);
}
.rx .rx-scard__img {
	position: absolute; inset: 0; z-index: -2;
	width: 100%; height: 100%; max-width: none;
	object-fit: cover;
	transition: transform 1.1s var(--rx-ease);
}
.rx-scard__shade {
	position: absolute; inset: 0; z-index: -1;
	background: linear-gradient(180deg, rgba(0,0,0,0) 42%, rgba(0,0,0,.55) 62%, rgba(0,0,0,.92) 80%, #010101 100%);
}
.rx-scard__body {
	position: absolute; left: 16px; right: 16px; bottom: 46px;
	display: block;
}
.rx .rx-scard__circle {
	position: absolute; right: 0; top: -24px;
	display: flex; align-items: center; justify-content: center;
	width: 48px; height: 48px; border-radius: 50%;
	border: 1px solid var(--rx-card-accent);
	color: var(--rx-card-accent);
	transition: background-color .4s var(--rx-ease), color .4s var(--rx-ease);
}
.rx-scard__circle .rx-arrow { transition: transform .4s var(--rx-ease); }
.rx .rx-scard__title {
	display: block; padding-right: 60px;
	font: 400 16px/20px var(--rx-font); letter-spacing: .225em;
}
.rx .rx-scard__text {
	display: block; margin-top: 7px;
	font: 400 14px/18px var(--rx-font); letter-spacing: 0;
}
.rx-scard__line {
	display: inline-block; vertical-align: middle;
	position: relative; top: 1.5px;
	width: 48px; height: 1px; margin: -3px 17px 0 0;
	background: var(--rx-card-accent);
}
@media (hover: hover) {
	.rx a.rx-scard:hover .rx-scard__img { transform: scale(1.05); }
	.rx a.rx-scard:hover .rx-scard__circle { background: var(--rx-card-accent); color: #0b0b0b; }
	.rx a.rx-scard:hover .rx-scard__circle .rx-arrow { transform: translateX(3px); }
}
.rx a.rx-scard:focus-visible { outline: 2px solid var(--rx-card-accent); outline-offset: 3px; }

/* ---------- Projects ---------- */
.rx-projects__viewport { position: relative; }
.rx .rx-projects__track {
	display: flex; gap: var(--rx-gap);
	overflow-x: auto; overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	outline: none;
	-webkit-overflow-scrolling: touch;
}
.rx .rx-projects__track::-webkit-scrollbar { display: none; }
.rx .rx-projects__track { scroll-behavior: auto; }
.rx .rx-projects__track.is-js,
.rx .rx-projects__track.is-anim { scroll-snap-type: none; }
.rx .rx-projects__track.is-js { cursor: grab; }
.rx .rx-projects__track.is-drag { scroll-snap-type: none; cursor: grabbing; }
.rx .rx-projects__track.is-drag * { pointer-events: none; }
.rx .rx-pcard {
	position: relative;
	flex: 0 0 calc((100% - 3 * var(--rx-gap)) / 4);
	min-width: 0; margin: 0;
	scroll-snap-align: start;
}
/* Текст проекта; днём — на стекле с блюром фона (заходит под фото на радиус скругления) */
.rx .rx-pcard__info {
	position: relative; z-index: 0;
	margin-top: calc(-1 * var(--rx-radius));
	padding: var(--rx-radius) var(--rx-p-glass-pad, 0px) 26px;
	background: var(--rx-p-glass, transparent);
	-webkit-backdrop-filter: var(--rx-p-glass-blur, none);
	backdrop-filter: var(--rx-p-glass-blur, none);
}
.rx .rx-pcard__media {
	position: relative; z-index: 1; display: block; overflow: hidden;
	aspect-ratio: 333 / 420;
	border-radius: var(--rx-radius);
	background: rgba(127,127,127,.15);
	isolation: isolate; transform: translateZ(0);
}
.rx .rx-pcard__img {
	position: absolute; inset: 0; z-index: -1;
	width: 100%; height: 100%; max-width: none;
	object-fit: cover;
	-webkit-user-drag: none; user-select: none;
	transition: transform 1.1s var(--rx-ease);
}
.rx .rx-pcard__title {
	margin: 32px 0 0; padding: 0;
	color: var(--rx-p-title);
	font: 400 16px/20px var(--rx-font); letter-spacing: .235em; text-transform: none;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rx .rx-pcard__place {
	margin: 8px 0 0; padding: 0;
	color: var(--rx-p-place);
	font: 400 14px/18px var(--rx-font); letter-spacing: 0;
}
.rx .rx-pcard__link {
	display: inline-flex; align-items: center;
	margin-top: 8px;
	color: var(--rx-p-link); text-decoration: none;
	font: 400 14px/18px var(--rx-font); letter-spacing: 0;
}
.rx-pcard__line { width: 48px; height: 1px; margin-right: 17px; background: currentColor; transition: width .4s var(--rx-ease); }
.rx-pcard__link .rx-arrow { margin-left: 16px; transition: transform .4s var(--rx-ease); }
@media (hover: hover) {
	.rx a.rx-pcard__media:hover .rx-pcard__img { transform: scale(1.04); }
	.rx a.rx-pcard__link:hover .rx-arrow { transform: translateX(4px); }
	.rx a.rx-pcard__link:hover .rx-pcard__line { width: 60px; }
}
.rx a.rx-pcard__link:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }

/* Кружок-курсор над фото (как в макете на 2-й карточке) */
.rx-cursor {
	position: fixed; left: 0; top: 0; z-index: 50;
	display: flex; align-items: center; justify-content: center;
	width: 48px; height: 48px; margin: -24px 0 0 -24px;
	box-sizing: border-box;
	border: 1px solid currentColor; border-radius: 50%;
	color: var(--rx-cursor);
	pointer-events: none;
	opacity: 0; transform: translate3d(-200px, -200px, 0) scale(.6);
	transition: opacity .3s var(--rx-ease), scale .3s var(--rx-ease);
}
.rx-cursor.is-on { opacity: 1; scale: 1; }
.rx-cursor .rx-arrow { width: 18px; }
.rx-projects.has-cursor a.rx-pcard__media { cursor: none; }

/* Пейджер */
.rx .rx-pager {
	display: flex; align-items: center; justify-content: center;
	width: fit-content; height: 24px;
	margin: 40px auto 0;
	padding: 0 calc(var(--rx-pager-pad, 0px) + 1px) 0 var(--rx-pager-pad, 0px);
	background: var(--rx-pager-glass, transparent);
	-webkit-backdrop-filter: var(--rx-pager-blur, none);
	backdrop-filter: var(--rx-pager-blur, none);
	color: var(--rx-pager);
}
.rx .rx-pager__count {
	flex: 0 0 auto; min-width: 68px; margin-right: 24px;
	font: 400 18px/1 var(--rx-font); letter-spacing: 0; white-space: nowrap;
	font-variant-numeric: tabular-nums;
}
.rx .rx-pager__bar {
	position: relative; flex: 0 1 360px; width: 360px; height: 1px;
	background: var(--rx-track);
}
.rx .rx-pager__fill {
	/* как у слайдера Process: заливка от начала линии; тёмное — пролистанное, светлое — что сейчас в кадре */
	position: absolute; left: 0; top: -.5px; height: 2px; width: 30%;
	background: linear-gradient(90deg, var(--rx-fill-a) 0, var(--rx-fill-a) calc(100% - var(--rx-seg, 100%)), var(--rx-fill-b) calc(100% - var(--rx-seg, 100%)), var(--rx-fill-b) 100%);
	box-shadow: 0 0 6px color-mix(in srgb, var(--rx-fill-b) 55%, transparent);
	transition: width .25s linear;
}
.rx .rx-pager__nav { display: flex; gap: 14px; margin-left: 25px; }
.rx .rx-btn {
	all: unset;
	display: inline-flex; align-items: center; justify-content: center;
	width: 20px; height: 24px;
	color: var(--rx-arrows);
	cursor: pointer;
	transition: opacity .3s, transform .3s var(--rx-ease);
}
.rx .rx-btn:disabled { opacity: .35; cursor: default; }
.rx .rx-btn:focus-visible { outline: 1px solid currentColor; outline-offset: 2px; }
@media (hover: hover) {
	.rx .rx-pager__prev:not(:disabled):hover { transform: translateX(-3px); }
	.rx .rx-pager__next:not(:disabled):hover { transform: translateX(3px); }
}
.rx-projects.is-static .rx-pager { display: none; }

/* ---------- Адаптив ---------- */
@media (max-width: 1100px) {
	.rx .rx-pcard { flex-basis: calc((100% - 2 * var(--rx-gap)) / 3); }
}
@media (max-width: 1024px) {
	.rx .rx-head { margin-bottom: 32px; }
	.rx-services__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Мобилка — по макету 375px (project/night.pdf): обе секции столбиком, текст проектов на фото */
@media (max-width: 767px) {
	.rx { --rx-radius: 24px; }
	.rx .rx-head { margin-bottom: 41px; }
	.rx .rx-head__label { padding-top: 0; font-size: 14px; }
	.rx .rx-head__line { flex-basis: 64px; }
	.rx .rx-head__title { margin: 14px -.16em 0 0; font-size: min(32px, 8.53vw); line-height: 1.25; letter-spacing: .16em; }
	.rx .rx-head__sub { max-width: 13.5em; margin-top: 16px; font-size: 14px; line-height: 18px; }

	/* Services: горизонтальные карточки одна под другой */
	.rx-services__grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
	.rx .rx-scard { aspect-ratio: 343 / 200; }
	.rx-scard__shade { background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(0,0,0,.45) 62%, rgba(0,0,0,.8) 100%); }
	.rx-scard__body { left: 16px; right: 16px; bottom: 15px; }
	.rx .rx-scard__title { padding-right: 48px; font-size: 14px; line-height: 18px; letter-spacing: .24em; }
	.rx .rx-scard__text { margin-top: 1px; padding-right: 48px; font-size: 12px; line-height: 16.5px; }
	.rx-scard__line { margin-right: 16.5px; }
	.rx .rx-scard__circle { top: auto; bottom: 1px; width: 32px; height: 32px; }

	/* Projects: страницы по 4 карточки столбиком, листаются стрелками / свайпом */
	.rx .rx-projects__track {
		display: grid; grid-auto-flow: column;
		grid-template-rows: repeat(4, auto);
		grid-auto-columns: calc(100% - 10px);
		gap: 20px;
	}
	.rx .rx-pcard {
		position: relative; overflow: hidden;
		display: flex; flex-direction: column; justify-content: flex-end;
		aspect-ratio: 333 / 200;
		padding: 0 16px 16.5px;
		border-radius: var(--rx-radius);
		isolation: isolate;
	}
	.rx .rx-pcard__media { position: absolute; inset: 0; z-index: -1; aspect-ratio: auto; border-radius: 0; }
	.rx .rx-pcard__media::after {
		content: ''; position: absolute; inset: 0;
		background: linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(0,0,0,.5) 100%);
	}
	.rx .rx-pcard__info { margin: 0; padding: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
	.rx .rx-pcard__title { margin: 0; font-size: 12px; line-height: 16.5px; letter-spacing: .24em; color: var(--rx-card-text); }
	.rx .rx-pcard__place { margin: 0; font-size: 12px; line-height: 16.5px; color: var(--rx-card-text); }
	.rx .rx-pcard__link { margin-top: 9.5px; font-size: 12px; line-height: 16.5px; }
	.rx-pcard__line { margin-right: 16.5px; }

	/* Пейджер: счётчик слева, стрелки справа, прогресс на всю ширину снизу */
	.rx .rx-pager {
		flex-wrap: wrap; justify-content: space-between;
		width: auto; height: auto; margin: 38px 0 0; padding: 0;
		background: none; -webkit-backdrop-filter: none; backdrop-filter: none;
		color: var(--rx-pager-m);
	}
	.rx .rx-btn { height: 28px; }
	.rx .rx-pager__count { min-width: 0; margin: 0; font-size: 14px; }
	.rx .rx-pager__nav { gap: 12px; margin: 0 2.5px 0 0; }
	.rx .rx-btn { color: var(--rx-pager-m); }
	.rx .rx-pager__bar { order: 3; flex: 0 0 100%; width: auto; margin-top: 13px; background: var(--rx-track-m); }
}
@media (min-width: 768px) and (max-width: 1100px) {
	.rx .rx-scard__title { letter-spacing: .16em; }
}

@media (prefers-reduced-motion: reduce) {
	.rx *, .rx *::before, .rx *::after { transition: none !important; }
}

/* ---------- Редактор Гутенберга ---------- */
.rx-editor { position: relative; padding: 32px; border-radius: 4px; }
.rx-editor--night { background: #0f1115; }
.rx-editor--day { background: #f4f3ef; }
.rx-editor a, .rx-editor button { pointer-events: none; }
.rx-editor .rx-cursor { display: none; }

/* 2.11.0: Services при 5+ услугах — лента как Projects (ПК 4 в кадре, планшет 2, мобилка страницы по 4 карточки столбиком) */
.rx-services--slider .rx-scard { flex: 0 0 calc((100% - 3 * var(--rx-gap)) / 4); min-width: 0; scroll-snap-align: start; }
@media (max-width: 1024px) {
	.rx-services--slider .rx-scard { flex-basis: calc((100% - var(--rx-gap)) / 2); }
}
@media (max-width: 767px) {
	/* обычная сетка Services задаёт колонку minmax(0, 1fr) — в ленте она сжималась в 0 и прятала первые 4 карточки */
	.rx-services--slider .rx-services__grid.rx-projects__track { grid-template-columns: none; gap: 12px 20px; }
}

/* 2.11.0: длинные названия проектов переносятся (раньше — многоточие), VIEW PROJECT у всех карточек ряда по низу */
.rx .rx-pcard__title { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
@media (min-width: 768px) {
	.rx-projects .rx-pcard { display: flex; flex-direction: column; }
	.rx-projects .rx-pcard__info { flex: 1 1 auto; display: flex; flex-direction: column; align-items: flex-start; }
	.rx-projects .rx-pcard__link { margin-top: auto; padding-top: 8px; }
}
/* заголовок секции, который JS разрешил переносить (слишком длинная строка) */
.rx .rx-head__title.is-wrap { white-space: normal; }
