/*
Theme Name: Magnific Ru
Description: Тема брендового справочника по Magnific (бывший Freepik). Язык дизайна — «контрольная шкала».
Version: 1.0.6
Author: Magnific Ru
*/

/* ─────────────────────────────────────────────
   Токены. Палитра снята с офсайта пипеткой:
   бумага и чернильный — фон и текст страницы,
   винный — кнопки и обводки, розовый — единственный
   акцент. Ширина контейнера 1216px тоже с офсайта.
   ───────────────────────────────────────────── */
:root {
	--paper: #f4f3ef;
	--paper-2: #fbfaf8;
	--ink: #1a1a1a;
	--ink-soft: #55524d;
	--wine: #2c0000;
	--wine-2: #4a0c1e;
	--pink: #ff58ae;
	--pink-deep: #c4176f;
	--light: #f5f5f5;
	--line: rgba(26, 26, 26, .14);
	--line-soft: rgba(26, 26, 26, .08);

	--shell: 1216px;
	--r: 8px;
	--gap: 24px;

	--h: "Sofia Sans Extra Condensed", "Arial Narrow", sans-serif;
	--t: "Noto Sans", "Segoe UI", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font: 400 17px/1.65 var(--t);
	overflow-x: hidden;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration-color: var(--pink); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }

h1, h2, h3, h4 {
	font-family: var(--h);
	font-weight: 800;
	letter-spacing: -.02em;
	line-height: 1.02;
	margin: 0 0 .5em;
	text-wrap: balance;
}
h1 { font-size: clamp(2.9rem, 6.4vw, 5.1rem); }
h2 { font-size: clamp(2.1rem, 4vw, 3.2rem); }
h3 { font-size: clamp(1.5rem, 2.3vw, 1.95rem); }
h4 { font-size: 1.25rem; }

p { margin: 0 0 1.1em; }
ul, ol { margin: 0 0 1.2em; padding-left: 1.25em; }
li { margin-bottom: .5em; }
li::marker { color: var(--pink-deep); }

.wrap { width: 100%; max-width: var(--shell); margin: 0 auto; padding: 0 24px; }
.wrap--text { }

.mute { color: var(--ink-soft); }
.nowrap { white-space: nowrap; }

/* ─────────────────────────────────────────────
   Кнопки — форма с офсайта: радиус 8px, высота 40,
   поля 12/24, 14px/500. Ничего не придумываем.
   ───────────────────────────────────────────── */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 40px; padding: 12px 24px;
	border-radius: var(--r); border: 1px solid transparent;
	font: 500 14px/1 var(--t); text-decoration: none; cursor: pointer;
	transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.btn--wine { background: var(--wine); color: #fff; }
.btn--wine:hover { background: #470303; }
.btn--line { background: transparent; color: var(--wine); border-color: var(--wine); }
.btn--line:hover { background: var(--wine); color: #fff; }
.btn--light { background: #fff; color: var(--ink); }
.btn--light:hover { background: var(--light); }
.btn--ghost { background: transparent; color: var(--light); border-color: rgba(245, 245, 245, .45); }
.btn--ghost:hover { background: rgba(245, 245, 245, .12); border-color: var(--light); }
/* Явное кольцо фокуса: винный тон на бумаге, розовый — на тёмных полотнах,
   чтобы клавиатурное состояние читалось на обоих фонах. */
.btn:focus-visible { outline: 3px solid var(--pink-deep); outline-offset: 3px; }
.hero .btn:focus-visible,
.sec--dark .btn:focus-visible,
.site-footer .btn:focus-visible { outline-color: var(--pink); }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ─────────────────────────────────────────────
   Калибровочная лента — несущая форма темы.
   Шесть ступеней от чернильного к бумажному;
   на ховере плитки наливаются розовым слева
   направо с задержкой по индексу.
   ───────────────────────────────────────────── */
.cal { display: flex; gap: 3px; margin-top: 18px; }
.cal i {
	display: block; width: 10px; height: 10px; border-radius: 2px;
	background: var(--step, var(--ink));
	transition: background-color .22s ease;
	transition-delay: calc(var(--i, 0) * 55ms);
}
.cal i:nth-child(1) { --step: #1a1a1a; --i: 0; }
.cal i:nth-child(2) { --step: #46433e; --i: 1; }
.cal i:nth-child(3) { --step: #6f6b64; --i: 2; }
.cal i:nth-child(4) { --step: #9a958d; --i: 3; }
.cal i:nth-child(5) { --step: #c6c2ba; --i: 4; }
.cal i:nth-child(6) { --step: #e6e3dc; --i: 5; }
.tile:hover .cal i, .tile:focus-within .cal i { background: var(--pink); }

/* Ступенчатая шкала — разделитель секций */
.scale { display: flex; align-items: center; gap: 14px; margin: 0 0 34px; }
.scale__ix { font: 700 13px/1 var(--t); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); white-space: nowrap; }
.scale__bar { display: flex; gap: 3px; flex: 1 1 auto; }
.scale__bar i { display: block; height: 8px; flex: 1 1 auto; border-radius: 2px; background: var(--line); }
.scale__bar i:nth-child(-n+3) { background: var(--ink); }
.scale__bar i:nth-child(4) { background: var(--pink); }

/* ─────────────────────────────────────────────
   Плитки
   ───────────────────────────────────────────── */
.tile {
	background: var(--paper-2);
	border: 1px solid var(--line);
	border-radius: var(--r);
	padding: 26px 24px 22px;
	display: flex; flex-direction: column;
}
.tile h3 { margin-bottom: .35em; }
.tile p:last-of-type { margin-bottom: 0; }
.tile--dark { background: var(--wine); border-color: transparent; color: var(--light); }
.tile--dark .cal i:nth-child(1) { --step: #f5f5f5; }
.tile--dark .cal i:nth-child(2) { --step: #cbbfc2; }
.tile--dark .cal i:nth-child(3) { --step: #a08a90; }
.tile--dark .cal i:nth-child(4) { --step: #75565e; }
.tile--dark .cal i:nth-child(5) { --step: #4d2f37; }
.tile--dark .cal i:nth-child(6) { --step: #331119; }
a.tile { text-decoration: none; }
a.tile:hover { border-color: rgba(26, 26, 26, .3); }

.grid { display: grid; gap: var(--gap); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ─────────────────────────────────────────────
   Шапка
   ───────────────────────────────────────────── */
.site-header {
	position: sticky; top: 0; z-index: 60;
	background: rgba(244, 243, 239, .92);
	backdrop-filter: saturate(1.4) blur(10px);
	border-bottom: 1px solid var(--line-soft);
}
.site-header--onhero { background: transparent; border-bottom-color: transparent; }
.hdr { display: flex; align-items: center; gap: 28px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; font-family: var(--h); font-weight: 800; font-size: 27px; letter-spacing: -.01em; }
.brand svg { width: 26px; height: 26px; flex: none; }
.brand span { color: inherit; }
.nav { display: flex; gap: 20px; margin-left: auto; }
.nav a { text-decoration: none; font-size: 15px; color: var(--ink-soft); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.hdr .btn { flex: none; }
.burger { display: none; margin-left: auto; width: 42px; height: 38px; border: 1px solid var(--line); border-radius: var(--r); background: transparent; cursor: pointer; padding: 0; }
.burger i { display: block; width: 18px; height: 2px; margin: 3px auto; background: var(--ink); }
.site-header--onhero .brand, .site-header--onhero .nav a { color: var(--light); }
.site-header--onhero .nav a:hover { color: #fff; }
.site-header--onhero .burger { border-color: rgba(245, 245, 245, .4); }
.site-header--onhero .burger i { background: var(--light); }

.mnav {
	display: none; padding: 10px 0 20px;
	/* Полный список длиннее экрана телефона, а шапка залипшая:
	   без своей прокрутки нижние пункты были бы недостижимы. */
	max-height: calc(100vh - 69px); overflow-y: auto; overscroll-behavior: contain;
}
.mnav a { display: block; padding: 11px 2px; text-decoration: none; border-bottom: 1px solid var(--line-soft); }
.mnav a[aria-current="page"] { color: var(--pink-deep); font-weight: 600; }
.mnav__gr {
	margin: 20px 0 2px; font-family: var(--h); font-weight: 700;
	font-size: 14px; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-soft);
}
.mnav__gr:first-child { margin-top: 4px; }
.is-open .mnav { display: block; }

/* Над первым экраном шапка прозрачная, а раскрытое меню ложится
   на фотографию: пока оно открыто, возвращаем бумажный фон. */
.site-header--onhero.is-open { background: rgba(244, 243, 239, .98); border-bottom-color: var(--line-soft); }
.site-header--onhero.is-open .brand { color: var(--ink); }
.site-header--onhero.is-open .burger { border-color: var(--line); }
.site-header--onhero.is-open .burger i { background: var(--ink); }

/* ─────────────────────────────────────────────
   Первый экран — винный градиент офсайта
   ───────────────────────────────────────────── */
.hero {
	/* Фото первого экрана лежит нижним слоем, винный градиент остаётся
	   сверху как затемняющий: без него барабан и заголовок не читаются. */
	background:
				url("images/hero-tanets.webp") 50% 40% / cover no-repeat #1d0511;
	color: var(--light);
	margin-top: -69px; padding: 150px 0 74px;
	min-height: 900px;
}
.hero__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .92fr); gap: 48px; align-items: center; }
.hero h1 { color: #fff; margin-bottom: .28em; }
.hero__lead { font-size: 18px; color: rgba(245, 245, 245, .82); max-width: 34em; }
.hero__tag {
	display: inline-flex; align-items: center; gap: 10px;
	padding: 7px 14px; margin-bottom: 22px;
	border: 1px solid rgba(245, 245, 245, .28); border-radius: 999px;
	font-size: 13px; color: rgba(245, 245, 245, .9);
}
.hero__tag b { color: var(--pink); font-weight: 600; }

/* Барабан возможностей — механика с офсайта */
.reel {
	position: relative; height: 343px; overflow: hidden;
	/* Затухание сверху и снизу — маской, а не цветной заливкой:
	   под барабаном лежит фотография, и непрозрачная полоса
	   читалась бы поверх неё отдельной панелью. */
	-webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 26%, #000 74%, transparent 100%);
	mask-image: linear-gradient(to bottom, transparent 0, #000 26%, #000 74%, transparent 100%);
	margin-left: auto;
}
.reel__track { transition: transform .62s cubic-bezier(.22, .61, .36, 1); will-change: transform; }
.reel__item {
	display: flex; align-items: center; gap: 12px;
	height: 49px;
	font-family: var(--h); font-weight: 800; font-size: 30px; letter-spacing: -.01em;
	color: var(--light); opacity: .12;
	transition: opacity .42s ease;
}
.reel__item::before {
	content: ""; width: 0; height: 0; flex: none;
	border-left: 9px solid var(--pink);
	border-top: 6px solid transparent; border-bottom: 6px solid transparent;
	opacity: 0; transition: opacity .42s ease;
}
.reel__item.is-on { opacity: 1; }
.reel__item.is-on::before { opacity: 1; }

/* ─────────────────────────────────────────────
   Секции
   ───────────────────────────────────────────── */
.sec { padding: 74px 0; }
.sec--tight { padding: 52px 0; }
.sec--dark { background: var(--wine); color: var(--light); }
.sec--dark .scale__ix { color: rgba(245, 245, 245, .66); }
.sec--dark .scale__bar i { background: rgba(245, 245, 245, .2); }
.sec--dark .scale__bar i:nth-child(-n+3) { background: var(--light); }
.sec--dark .scale__bar i:nth-child(4) { background: var(--pink); }
.sec--dark .tile { background: rgba(245, 245, 245, .06); border-color: rgba(245, 245, 245, .16); color: var(--light); }
.sec--paper2 { background: var(--paper-2); }

.lead { font-size: 19px; color: var(--ink-soft); max-width: 42em; }

.page-head { padding: 54px 0 30px; }
.page-head h1 { margin-bottom: .22em; }

.crumbs { font-size: 14px; color: var(--ink-soft); padding: 20px 0 0; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

.content { max-width: 880px; }
.content h2 { margin-top: 1.5em; }
.content h3 { margin-top: 1.3em; }
.content > *:first-child { margin-top: 0; }

/* ─────────────────────────────────────────
   Иллюстрации. Квадратные и почти квадратные кадры во всю
   ширину колонки дают полтора экрана высоты — отсюда max-width.
   ───────────────────────────────────────── */
.fig { margin: 30px 0 34px; }
.fig img,
.fig video {
	display: block; width: 100%; height: auto;
	border: 1px solid var(--line);
	border-radius: var(--r);
	background: var(--paper-2);
}
.fig--col { max-width: 880px;
    margin: 0 auto;
    margin-bottom: 40px; }
.fig--wide { max-width: none; }
.fig figcaption { margin-top: 10px; font-size: 14px; color: var(--ink-soft); }

/* Врезка */
.note {
	border-left: 3px solid var(--pink);
	background: var(--paper-2);
	border-radius: 0 var(--r) var(--r) 0;
	padding: 18px 22px; margin: 26px 0;
}
.note p:last-child { margin-bottom: 0; }

/* ─────────────────────────────────────────────
   Таблицы
   ───────────────────────────────────────────── */
/* Обёртка — единственное, что имеет право ехать по горизонтали.
   min-width:0 нужен, чтобы во flex/grid-родителе (.tile, .hero__grid)
   обёртку не раздувало содержимым шире своей колонки, а overscroll-behavior
   не даёт докрутке таблицы утащить за собой страницу на тач-экране. */
.table-wrap {
	overflow-x: auto;
	overscroll-behavior-x: contain;
	-webkit-overflow-scrolling: touch;
	min-width: 0; max-width: 100%;
	margin: 26px 0; border: 1px solid var(--line); border-radius: var(--r);
}
/* Полотно таблицы всегда светлое (paper-2), поэтому и цвет текста задаём
   явно: внутри .sec--dark/.tile--dark/подвала таблица иначе наследует
   светлый color и текст пропадает на своём же светлом фоне. */
table.data { width: 100%; border-collapse: collapse; font-size: 15.5px; background: var(--paper-2); color: var(--ink); }
table.data th, table.data td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.data th { font-family: var(--h); font-weight: 700; font-size: 19px; letter-spacing: 0; background: var(--paper); }
table.data tr:last-child td { border-bottom: 0; }
table.data .num { font-family: var(--h); font-weight: 700; font-size: 21px; white-space: nowrap; }

/* ─────────────────────────────────────────────
   Тарифы: сегментный свитч с офсайта
   ───────────────────────────────────────────── */
.switchbar { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-bottom: 30px; }
.seg { display: inline-flex; gap: 4px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 999px; }
.seg button {
	border: 0; background: transparent; color: var(--ink);
	padding: 0 24px; min-height: 40px; border-radius: 999px;
	font: 500 14px/1 var(--t); cursor: pointer;
	transition: background-color .18s ease, color .18s ease;
}
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.period { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; }
.period button {
	position: relative; width: 46px; height: 26px; padding: 0;
	border: 0; border-radius: 999px; background: var(--ink); cursor: pointer;
}
.period button::after {
	content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
	border-radius: 50%; background: #fff; transition: transform .2s ease;
}
.period button[aria-pressed="false"]::after { transform: translateX(0); }
.period button[aria-pressed="true"]::after { transform: translateX(20px); }
.period .save { color: var(--ink-soft); }

.plans { display: grid; gap: var(--gap); grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
.plans--team { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.plan { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r); padding: 26px 24px; }
.plan--best { border-color: var(--wine); border-width: 2px; }
.plan__badge { display: inline-block; font: 500 12px/1 var(--t); border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; margin-bottom: 12px; }
.plan--best .plan__badge { border-color: var(--wine); color: var(--wine); }
.plan__price { display: flex; align-items: baseline; gap: 9px; margin: 14px 0 6px; }
.plan__now { font-family: var(--h); font-weight: 800; font-size: 46px; line-height: 1; }
.plan__was { font-family: var(--h); font-weight: 700; font-size: 26px; color: var(--ink-soft); text-decoration: line-through; }
.plan__per { font-size: 14px; color: var(--ink-soft); }
.plan__cr { font-size: 14.5px; color: var(--ink-soft); margin-bottom: 18px; }
.plan ul { list-style: none; padding: 0; margin: 18px 0 0; font-size: 15px; }
.plan ul li { position: relative; padding-left: 24px; margin-bottom: 9px; }
.plan ul li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 11px; height: 6px; border-left: 2px solid var(--pink-deep); border-bottom: 2px solid var(--pink-deep); transform: rotate(-45deg); }
.plan .btn { width: 100%; }
[hidden] { display: none !important; }

/* ─────────────────────────────────────────────
   FAQ
   ───────────────────────────────────────────── */
.faq { margin: 34px 0 0; }
.faq details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq summary {
	cursor: pointer; list-style: none; padding: 16px 34px 16px 0; position: relative;
	font-family: var(--h); font-weight: 700; font-size: 21px; letter-spacing: 0;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
	content: ""; position: absolute; right: 6px; top: 50%; width: 9px; height: 9px;
	border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink);
	transform: translateY(-70%) rotate(45deg); transition: transform .2s ease;
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq .faq__a { padding: 0 0 18px; }
.faq .faq__a p:last-child { margin-bottom: 0; }

/* Рейтинг */
.rating { display: inline-flex; align-items: center; gap: 10px; }
.stars { display: inline-flex; gap: 2px; }
.stars svg { width: 17px; height: 17px; }
.rating b { font-family: var(--h); font-size: 25px; font-weight: 800; }

/* Отзывы */
.rev { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.rev__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.rev__who { font-family: var(--h); font-weight: 700; font-size: 20px; }
.rev p { font-size: 15.5px; margin-bottom: 0; }

/* Ссылки-соседи */
.related { margin: 46px 0 0; }
.related ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.related li { margin: 0; }
.related a {
	display: inline-block; padding: 9px 16px; border: 1px solid var(--line);
	border-radius: 999px; text-decoration: none; font-size: 14.5px; background: var(--paper-2);
}
.related a:hover { border-color: var(--ink); }

/* Подвал */
.site-footer { background: var(--wine); color: rgba(245, 245, 245, .78); padding: 56px 0 34px; margin-top: 70px; }
.site-footer h3 { color: var(--light); font-size: 22px; margin-bottom: .6em; }
.foot { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.site-footer ul { list-style: none; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { text-decoration: none; }
/* :not(.btn) обязателен. Без него это правило перебивало цвет .btn--light
   (специфичность 0-2-1 против 0-1-0) и красило текст кнопки в белый
   поверх её же белой заливки — на ховере кнопка становилась пустой. */
.site-footer a:not(.btn):hover { color: #fff; text-decoration: underline; }
.site-footer .btn--light:hover,
.site-footer .btn--light:focus-visible { background: var(--light); color: var(--ink); text-decoration: none; }
.foot-note { border-top: 1px solid rgba(245, 245, 245, .18); margin-top: 38px; padding-top: 22px; font-size: 13.5px; color: rgba(245, 245, 245, .6); }
.foot-note p { margin-bottom: .6em; }

/* Мобильная кнопка: ниже 940px кнопка из шапки уходит, и реф-ссылка
   должна остаться на виду с первого экрана на любой странице. */
.mcta { display: none; }
@media (max-width: 940px) {
	.mcta {
		display: block;
		position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
		padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
		background: rgba(244, 243, 239, .94);
		backdrop-filter: saturate(1.4) blur(10px);
		border-top: 1px solid var(--line);
	}
	.mcta .btn { width: 100%; }
	body { padding-bottom: 70px; }
}

/* ─────────────────────────────────────────────
   Брейкпоинты — своя лестница: 1120 / 940 / 720 / 560 / 380
   ───────────────────────────────────────────── */
@media (max-width: 1120px) {
	.grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.hero__grid { gap: 34px; }
}
@media (max-width: 940px) {
	.nav { display: none; }
	.burger { display: block; }
	.hdr .btn--hdr { display: none; }
	.hero__grid { grid-template-columns: minmax(0, 1fr); }
	.reel { height: 245px; }
	.reel__item { font-size: 25px; height: 41px; }
	.grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.plans { grid-template-columns: minmax(0, 1fr); }
	.foot { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
	body { font-size: 16.5px; }
	.sec { padding: 54px 0; }
	.grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }
	.hero { padding: 108px 0 60px; }
	.foot { grid-template-columns: 1fr; gap: 28px; }
	table.data th, table.data td { padding: 11px 12px; }
}
@media (max-width: 560px) {
	.wrap { padding: 0 16px; }
	.tile { padding: 22px 18px 18px; }
	.seg { width: 100%; }
	.seg button { flex: 1 1 0; padding: 0 10px; }
	.switchbar { gap: 12px; }
	.plan__now { font-size: 40px; }
	table.data { font-size: 14.5px; }
}
@media (max-width: 380px) {
	.brand { font-size: 23px; }
	.hdr { gap: 12px; }
	.btn { padding: 12px 16px; }
}

@media (prefers-reduced-motion: reduce) {
	.reel__track { transition: none; }
	.cal i { transition: none; }
	* { scroll-behavior: auto; }
}
