/**
 * Horizon — вид page-preloader (геометрия + --ccc-*).
 * Логика: js/cotcustom-preloader.js. Разметка пустая в header.tpl.
 */

/* Пока грузится: контент не виден и не скроллится; спиннер — visibility:visible у потомка */
html.cotcustom-is-preloading body {
	overflow: hidden;
	position: fixed;
	visibility: hidden;
	width: 100%;
}

html.cotcustom-is-preloading .cotcustom-preloader {
	visibility: visible;
}

.cotcustom-preloader {
	box-sizing: border-box;
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0;
	background: var(--ccc-bg);
	pointer-events: none;
	opacity: 1;
	transition: opacity 0.3s ease;
}

.cotcustom-preloader--done {
	opacity: 0;
}

.cotcustom-preloader__spinner {
	box-sizing: border-box;
	position: relative;
	display: block;
	width: 142px;
	height: 142px;
	margin: auto;
	animation: cotcustom-preloader-rotate 10s infinite linear;
}

.cotcustom-preloader__spinner i {
	box-sizing: border-box;
	position: absolute;
	display: inline-block;
	top: 50%;
	left: 50%;
	border: solid 6px transparent;
	border-bottom: none;
	transform-origin: 50% 100% 0;
	animation: cotcustom-preloader-rotate 3s infinite cubic-bezier(0.09, 0.6, 0.8, 0.03);
}

/* Дуги → палитра CCC (docs/ru/32-palette.md) */
.cotcustom-preloader__spinner i:nth-child(1) {
	animation-timing-function: cubic-bezier(0.09, 0.3, 0.12, 0.03);
	width: 44px;
	height: 22px;
	margin-top: -22px;
	margin-left: -22px;
	border-color: var(--ccc-action);
	border-top-left-radius: 36px;
	border-top-right-radius: 36px;
}

.cotcustom-preloader__spinner i:nth-child(2) {
	animation-timing-function: cubic-bezier(0.09, 0.6, 0.24, 0.03);
	width: 58px;
	height: 29px;
	margin-top: -29px;
	margin-left: -29px;
	border-color: var(--ccc-action-soft);
	border-top-left-radius: 42px;
	border-top-right-radius: 42px;
}

.cotcustom-preloader__spinner i:nth-child(3) {
	animation-timing-function: cubic-bezier(0.09, 0.9, 0.36, 0.03);
	width: 72px;
	height: 36px;
	margin-top: -36px;
	margin-left: -36px;
	border-color: var(--ccc-success);
	border-top-left-radius: 48px;
	border-top-right-radius: 48px;
}

.cotcustom-preloader__spinner i:nth-child(4) {
	animation-timing-function: cubic-bezier(0.09, 1.2, 0.48, 0.03);
	width: 86px;
	height: 43px;
	margin-top: -43px;
	margin-left: -43px;
	border-color: var(--ccc-warning);
	border-top-left-radius: 54px;
	border-top-right-radius: 54px;
}

.cotcustom-preloader__spinner i:nth-child(5) {
	animation-timing-function: cubic-bezier(0.09, 1.5, 0.6, 0.03);
	width: 100px;
	height: 50px;
	margin-top: -50px;
	margin-left: -50px;
	border-color: var(--ccc-danger);
	border-top-left-radius: 60px;
	border-top-right-radius: 60px;
}

.cotcustom-preloader__spinner i:nth-child(6) {
	animation-timing-function: cubic-bezier(0.09, 1.8, 0.72, 0.03);
	width: 114px;
	height: 57px;
	margin-top: -57px;
	margin-left: -57px;
	border-color: var(--ccc-brand);
	border-top-left-radius: 66px;
	border-top-right-radius: 66px;
}

.cotcustom-preloader__spinner i:nth-child(7) {
	animation-timing-function: cubic-bezier(0.09, 2.1, 0.84, 0.03);
	width: 128px;
	height: 64px;
	margin-top: -64px;
	margin-left: -64px;
	border-color: var(--ccc-action-hover);
	border-top-left-radius: 72px;
	border-top-right-radius: 72px;
}

@keyframes cotcustom-preloader-rotate {
	to {
		transform: rotate(360deg);
	}
}
