/*
Theme Name: Hailuo MiniMax Ru
Theme URI: https://hailuo-minimax.click/
Author: Hailuo MiniMax Ru
Description: Тема брендового сайта Hailuo MiniMax Ru (hailuo-minimax.click). Тёмная база и фиолетовый акцент сняты из CSS официального приложения hailuoai.video.
Version: 1.0.0
Text Domain: hailuo-minimax-ru
*/

/* ── Токены. Цвета сняты из бандлов cdn.hailuoai.video ── */
:root {
	--bg: #0a0a0d;
	--bg-2: #101116;
	--surface: #14151b;
	--surface-2: #1a1c23;
	--line: #262832;
	--line-soft: #1d1f27;
	--text: #f5f6ff;
	--text-mut: rgba(235, 238, 255, .72);
	--text-dim: rgba(224, 229, 255, .42);
	--violet: #7657ff;
	--violet-lt: #8375ff;
	--amber: #ffab0c;
	--flame: #ff5538;
	--crimson: #e9405d;
	--orchid: #d266da;
	--lilac: #d584ef;
	--mint: #e2fffa;
	--grad: linear-gradient(93.4deg, #ffab0c -2.2%, #ff5538 28.11%, #e9405d 48.77%, #d266da 88.72%, #d584ef 108.01%);
	--grad-soft: linear-gradient(93.4deg, rgba(255,171,12,.14), rgba(233,64,93,.14) 50%, rgba(213,132,239,.14));
	--maxw: 1140px;
	--r: 16px;
	--r-sm: 10px;
	--font-h: 'Unbounded', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--font-b: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font-b);
	font-size: 17px;
	line-height: 1.68;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

h1, h2, h3, h4 { font-family: var(--font-h); font-weight: 700; line-height: 1.18; letter-spacing: -.02em; margin: 0 0 .6em; color: var(--text); }
h1 { font-size: clamp(1.7rem, 4.2vw, 2.7rem); font-weight: 800; }
h2 { font-size: clamp(1.35rem, 3vw, 1.9rem); margin-top: 2em; }
h3 { font-size: clamp(1.05rem, 2vw, 1.2rem); margin-top: 1.7em; font-weight: 600; }
p { margin: 0 0 1.1em; color: var(--text-mut); }
a { color: var(--violet-lt); text-decoration: none; }
a:hover { text-decoration: underline; }
strong { color: var(--text); font-weight: 600; }
img, video { max-width: 100%; height: auto; display: block; }
code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: .9em; }
ul, ol { color: var(--text-mut); padding-left: 22px; }
li { margin-bottom: .5em; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 840px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ── Шапка ── */
.hdr { position: sticky; top: 0; z-index: 60; background: rgba(10, 10, 13, .86); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line-soft); }
.hdr__in { display: flex; align-items: center; gap: 14px; height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); flex-shrink: 0; }
.logo:hover { text-decoration: none; }
.logo__mark { width: 32px; height: 32px; border-radius: 9px; background: var(--grad); display: grid; place-items: center; flex-shrink: 0; }
.logo__mark svg { width: 18px; height: 18px; color: #14060a; }
.logo__text { font-family: var(--font-h); font-weight: 700; font-size: .98rem; letter-spacing: -.03em; white-space: nowrap; }
.logo__text span { color: var(--text-dim); font-weight: 500; }

.nav { display: flex; align-items: center; gap: 2px; margin-left: auto; flex-wrap: wrap; }
.nav a { color: var(--text-mut); font-size: .87rem; font-weight: 500; padding: 7px 10px; border-radius: 8px; white-space: nowrap; }
.nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav a.is-active { color: var(--text); background: rgba(118, 87, 255, .16); }

.burger { display: none; background: none; border: 0; color: var(--text); padding: 6px; cursor: pointer; border-radius: 8px; }
.burger svg { width: 24px; height: 24px; }
/* CTA в шапке видна ВСЕГДА, в том числе на мобильном рядом с бургером */
.hdr__cta { flex-shrink: 0; }
.cta-short { display: none; }

/* ── Кнопки ── */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	font-family: var(--font-h); font-weight: 600; font-size: .92rem;
	padding: 12px 20px; border-radius: 11px; border: 1px solid transparent; cursor: pointer;
	transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
	line-height: 1.15; text-align: center;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn--primary { background: #ffab0c; color: #16070c; box-shadow: 0 8px 26px -10px rgba(233, 64, 93, .6); }
.btn--primary:hover { box-shadow: 0 12px 32px -10px rgba(233, 64, 93, .75); }
.btn--tg { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.btn--tg:hover { border-color: var(--violet); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--violet); }
.btn--sm { padding: 9px 15px; font-size: .84rem; border-radius: 9px; }

/* ── Hero: тёмная сцена с плёночной лентой ── */
.hero { position: relative; padding: 56px 0 54px; overflow: hidden; }
.hero::before {
	content: ''; position: absolute; inset: -35% 45% 45% -15%;
	background: radial-gradient(closest-side, rgba(118, 87, 255, .28), transparent 70%);
	filter: blur(30px); pointer-events: none;
}
.hero::after {
	content: ''; position: absolute; inset: 15% -20% 5% 55%;
	background: radial-gradient(closest-side, rgba(233, 64, 93, .2), transparent 70%);
	filter: blur(34px); pointer-events: none;
}
.hero__in { position: relative; z-index: 2; max-width: 900px;
    text-align: center; }
.badge {
	display: inline-flex; align-items: center; gap: 8px;
	background: var(--surface-2); border: 1px solid var(--line);
	color: var(--text-mut); font-size: .79rem; font-weight: 500;
	padding: 6px 13px; border-radius: 999px; margin-bottom: 18px;
}
.badge svg { width: 14px; height: 14px; color: var(--amber); }
.hero p.lead { font-size: 1.06rem; color: var(--text-mut); max-width: 640px; margin: 0 auto; margin-bottom: 22px; }
.hero__cta { display: flex; gap: 11px; flex-wrap: wrap; align-items: center;     justify-self: center; }
.hero__note { font-size: .8rem; color: var(--text-dim); margin: 13px 0 0; }
.hero__rating { display: flex; align-items: center; gap: 10px; margin-top: 22px; flex-wrap: wrap;     justify-self: center;}
.hero__rating b { font-family: var(--font-h); font-size: 1.3rem; }
.hero__rating span { color: var(--text-dim); font-size: .83rem; }

/* Плёночная лента — фирменный мотив сайта. Три ролика из video/ темы.
   Ширина ленты ограничена, чтобы кадры не разрастались на всю колонку:
   пропорцию держит aspect-ratio, размер задаётся только max-width. */
.filmstrip {
	display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
	 max-width: 1020px;
    margin: 0 auto; margin-top: 34px; position: relative; z-index: 2;
}
.filmstrip div {
	aspect-ratio: 9 / 13; border-radius: 12px; border: 1px solid var(--line);
	background: var(--surface); position: relative; overflow: hidden;
}
.filmstrip__vid {
	position: absolute; inset: 0; z-index: 0;
	width: 100%; height: 100%; object-fit: cover;
}
/* Тонировка держит фирменный цвет ячейки, нижний градиент — под подпись.
   Альфы низкие: при прежней .8 видео уходило под заливку. */
.filmstrip div::after {
	content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
	background: var(--grad-soft), linear-gradient(180deg, rgba(10,10,13,0) 55%, rgba(10,10,13,.72));
}
.filmstrip div:nth-child(2)::after {
	background: linear-gradient(180deg, rgba(118,87,255,.26), rgba(118,87,255,0) 55%),
		linear-gradient(180deg, rgba(10,10,13,0) 55%, rgba(10,10,13,.72));
}
.filmstrip span {
	position: absolute; left: 10px; bottom: 8px; z-index: 2;
	font-family: var(--font-h); font-size: .68rem; color: var(--text-dim); letter-spacing: .02em;
}

/* С 500px и ниже три кадра в ряд ужимаются до ~146px — оставляем один,
   третий. Селектор с :last-child — страховка: если файлов в video/
   меньше трёх, лента не окажется пустой. */
@media (max-width: 500px) {
	.filmstrip { grid-template-columns: 1fr; max-width: 240px; margin-left: auto; margin-right: auto; }
	.filmstrip div:not(:nth-child(3)):not(:last-child) { display: none; }
}

/* ── Секции ── */
.sec { padding: 54px 0; }
.sec--alt { background: var(--bg-2); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.sec__head { max-width: 720px; margin-bottom: 32px; }
.sec__head h2 { margin-top: 0; }
.sec__head p { margin-bottom: 0; }

/* ── Цифры ── */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 18px; position: relative; overflow: hidden; }
.stat::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--grad); }
.stat b { display: block; font-family: var(--font-h); font-size: 1.5rem; font-weight: 700; line-height: 1.1; margin-bottom: 6px; }
.stat span { color: var(--text-dim); font-size: .84rem; line-height: 1.45; }

/* ── Сетки и карточки ── */
.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 24px 22px; }
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.card--accent { border-color: rgba(118, 87, 255, .4); background: linear-gradient(180deg, rgba(118, 87, 255, .09), transparent 60%), var(--surface); }
.card__icon { width: 40px; height: 40px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; margin-bottom: 14px; }
.card__icon svg { width: 20px; height: 20px; color: var(--violet-lt); }

/* ── Шаги ── */
.steps { counter-reset: step; display: grid; gap: 14px; }
.step { display: grid; grid-template-columns: 46px 1fr; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; }
.step::before {
	counter-increment: step; content: counter(step, decimal-leading-zero);
	font-family: var(--font-h); font-size: 1.2rem; font-weight: 800;
	background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.step h3 { margin: 0 0 6px; font-size: 1.05rem; }
.step p:last-child { margin-bottom: 0; }

/* ── Таблицы: на узких экранах — карточки по строкам ── */
.tbl-wrap { overflow-x: auto; margin: 0 0 22px; border: 1px solid var(--line); border-radius: var(--r); }
table.tbl { width: 100%; border-collapse: collapse; min-width: 560px; font-size: .93rem; }
table.tbl th, table.tbl td { text-align: left; padding: 12px 15px; border-bottom: 1px solid var(--line-soft); vertical-align: top; color: var(--text-mut); }
table.tbl thead th { background: var(--surface-2); color: var(--text); font-family: var(--font-h); font-weight: 600; font-size: .85rem; }
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl td strong { color: var(--text); }

/* ── Тарифы ── */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 24px 22px; display: flex; flex-direction: column; }
.plan--hot { border-color: rgba(233, 64, 93, .45); box-shadow: 0 18px 50px -30px rgba(233, 64, 93, .8); }
.plan__name { font-family: var(--font-h); font-weight: 600; font-size: 1.05rem; margin-bottom: 4px; }
.plan__price { font-family: var(--font-h); font-size: 1.9rem; font-weight: 800; line-height: 1.1; margin: 10px 0 2px; }
.plan__rub { color: var(--text-dim); font-size: .82rem; margin-bottom: 14px; }
.plan__old { color: var(--text-dim); font-size: .85rem; text-decoration: line-through; margin-left: 8px; font-family: var(--font-b); font-weight: 400; }
.plan ul { list-style: none; padding: 0; margin: 0 0 18px; }
.plan li { display: flex; gap: 9px; font-size: .9rem; margin-bottom: 9px; }
.plan li svg { width: 16px; height: 16px; color: var(--orchid); flex-shrink: 0; margin-top: 4px; }
.plan .btn { margin-top: auto; }

/* ── Калькулятор кредитов ── */
.calc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 24px 22px; }
.calc__row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.calc label { display: block; font-size: .82rem; color: var(--text-dim); margin-bottom: 6px; }
.calc select {
	width: 100%; background: var(--surface-2); color: var(--text); border: 1px solid var(--line);
	border-radius: var(--r-sm); padding: 10px 12px; font-family: var(--font-b); font-size: .92rem;
}
.calc__out { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; border-top: 1px solid var(--line-soft); padding-top: 18px; }
.calc__cell b { display: block; font-family: var(--font-h); font-size: 1.45rem; font-weight: 700; line-height: 1.15; }
.calc__cell span { color: var(--text-dim); font-size: .82rem; }
.calc__note { color: var(--text-dim); font-size: .8rem; margin: 16px 0 0; }

/* ── Звёзды ── */
.stars { position: relative; display: inline-flex; line-height: 0; vertical-align: middle; }
.stars__bg, .stars__fg { display: flex; gap: 2px; }
.stars__bg { color: var(--text-dim); opacity: .35; }
/* не inset: 0 — он переопределяет инлайновую ширину заливки */
.stars__fg { position: absolute; top: 0; left: 0; bottom: 0; overflow: hidden; white-space: nowrap; color: var(--amber); }
/* fill обязателен: иконки Lucide приходят с fill="none", без заливки любая оценка читается как пятёрка */
.stars svg { width: var(--star-size, 18px); height: var(--star-size, 18px); flex-shrink: 0; fill: currentColor; }

/* ── Отзывы ── */
.rev { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.rev__top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.rev__ava { width: 40px; height: 40px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; font-family: var(--font-h); font-weight: 700; color: #16070c; flex-shrink: 0; }
.rev__name { font-family: var(--font-h); font-weight: 600; font-size: .95rem; }
.rev__role { color: var(--text-dim); font-size: .8rem; }
.rev__date { margin-left: auto; color: var(--text-dim); font-size: .78rem; }
.rev p { margin-bottom: 0; font-size: .95rem; }

/* Полосы оценок по критериям */
.rbars { display: grid; gap: 12px; }
.rbar { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; align-items: center; }
.rbar__label { color: var(--text-mut); font-size: .9rem; }
.rbar__val { font-family: var(--font-h); font-weight: 700; font-size: .92rem; }
.rbar__track { grid-column: 1 / -1; height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
/* display:block обязателен — это <span>, у инлайнового элемента width/height игнорируются */
.rbar__fill { display: block; height: 100%; background: var(--grad); border-radius: 99px; }

/* ── FAQ ── */
.faq { display: grid; gap: 10px; }
.faq__item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.faq__q {
	width: 100%; text-align: left; background: none; border: 0; color: var(--text); cursor: pointer;
	font-family: var(--font-h); font-weight: 600; font-size: .97rem; padding: 16px 46px 16px 18px;
	position: relative; line-height: 1.4;
}
.faq__q::after {
	content: ''; position: absolute; right: 18px; top: 22px; width: 9px; height: 9px;
	border-right: 2px solid var(--text-dim); border-bottom: 2px solid var(--text-dim);
	transform: rotate(45deg); transition: transform .2s ease;
}
.faq__item.open .faq__q::after { transform: rotate(-135deg); }
.faq__a { display: none; padding: 0 18px 18px; color: var(--text-mut); font-size: .95rem; }
.faq__item.open .faq__a { display: block; }

/* ── CTA-блок ── */
.ctabox { background: linear-gradient(180deg, rgba(118, 87, 255, .12), transparent 70%), var(--surface); border: 1px solid rgba(118, 87, 255, .35); border-radius: 20px; padding: 32px 28px; text-align: center; }
.ctabox h2 { margin-top: 0; }
.ctabox p { max-width: 620px; margin-left: auto; margin-right: auto; }
.ctabox__btns { display: flex; gap: 11px; justify-content: center; flex-wrap: wrap; }

/* ── Заметка/выноска ── */
.note { background: var(--surface-2); border-left: 3px solid var(--violet); border-radius: 0 var(--r-sm) var(--r-sm) 0; padding: 16px 18px; margin: 0 0 22px; }
.note p:last-child { margin-bottom: 0; }
.note strong { color: var(--text); }

/* ── Крошки, страницы ── */
.crumbs { display: flex; gap: 8px; align-items: center; font-size: .82rem; color: var(--text-dim); padding: 22px 0 0; flex-wrap: wrap; }
.crumbs a { color: var(--text-dim); }
.crumbs a:hover { color: var(--text); }
.crumbs__cur { color: var(--text-mut); }
.page-head { padding: 14px 0 8px; }
.page-head h1 { margin-bottom: .4em; }
.page-head .lead { font-size: 1.04rem; color: var(--text-mut); max-width: 720px; }
.content { padding-bottom: 60px; }
.content h2:first-child { margin-top: .6em; }

/* ── Читайте также ── */
.related { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.related a { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 16px 18px; color: var(--text); font-family: var(--font-h); font-weight: 600; font-size: .95rem; }
.related a:hover { border-color: var(--violet); text-decoration: none; }
.related span { display: block; color: var(--text-dim); font-family: var(--font-b); font-weight: 400; font-size: .84rem; margin-top: 4px; }

/* ── Подвал ── */
.ftr { background: var(--bg-2); border-top: 1px solid var(--line-soft); padding: 40px 0 28px; }
.ftr__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; margin-bottom: 26px; }
.ftr__col h4 { font-family: var(--font-h); font-size: .9rem; font-weight: 600; margin: 0 0 12px; }
.ftr__col a { display: block; color: var(--text-dim); font-size: .87rem; margin-bottom: 8px; }
.ftr__col a:hover { color: var(--text); }
.ftr__about { color: var(--text-dim); font-size: .87rem; max-width: 360px; }
.ftr__bottom { border-top: 1px solid var(--line-soft); padding-top: 18px; color: var(--text-dim); font-size: .8rem; }
.ftr__bottom p { color: var(--text-dim); font-size: .8rem; margin: 0 0 6px; }

/* ── Адаптив ── */
@media (max-width: 1000px) {
	.grid--3, .plans, .related { grid-template-columns: repeat(2, 1fr); }
	.stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
	.burger { display: inline-flex; margin-left: auto; order: 3; }
	.hdr__cta { order: 2; margin-left: auto; }
	.nav {
		display: none; position: absolute; top: 64px; left: 0; right: 0;
		background: var(--bg-2); border-bottom: 1px solid var(--line);
		flex-direction: column; align-items: stretch; padding: 10px 16px 16px; gap: 2px; margin: 0;
	}
	.nav.open { display: flex; }
	.nav a { padding: 11px 12px; font-size: .95rem; }
}

@media (max-width: 720px) {
	.grid--2, .grid--3, .plans, .related, .calc__row, .calc__out { grid-template-columns: 1fr; }
	.ftr__grid { grid-template-columns: 1fr; gap: 22px; }
}

@media (max-width: 640px) {
	body { font-size: 16px; }
	.hero { padding: 38px 0 40px; }
	.sec { padding: 40px 0; }
	.stats { grid-template-columns: 1fr; }
	.hero__cta .btn { width: 100%; }
	.ctabox { padding: 26px 18px; }

	/* Таблицы → карточки по строкам, без горизонтальной прокрутки */
	.tbl-wrap { overflow-x: visible; border: 0; }
	table.tbl { min-width: 0; }
	table.tbl thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
	table.tbl, table.tbl tbody, table.tbl tr, table.tbl td { display: block; width: 100%; }
	table.tbl tr { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; margin-bottom: 12px; background: var(--surface); }
	table.tbl td { padding: 6px 0; border: 0; display: flex; justify-content: space-between; gap: 14px; text-align: right; }
	table.tbl td::before { content: attr(data-label); font-family: var(--font-h); font-weight: 600; font-size: .8rem; color: var(--text-dim); text-align: left; flex-shrink: 0; }
}

@media (max-width: 480px) {
	.cta-full { display: none; }
	.cta-short { display: inline; }
	.hdr__cta .btn { padding: 9px 13px; font-size: .82rem; }
}

@media (max-width: 380px) {
	.logo__text { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	* { transition: none !important; }
}
