/* d1 — «Журнальный редакторский». Всё оформление на шести переменных генератора. */

:root {
	/* базовые — перезаписываются блоком Custom overrides в конце файла */
	--color-bg: #ffffff;
	--color-surface: #f7f7f7;
	--color-text: #1a1a1a;
	--color-accent: #2563eb;
	--font-base: 'Segoe UI', system-ui, sans-serif;
	--radius: 8px;

	/* производные — считаются от базовых, поэтому подхватывают любую палитру */
	--font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	--line: color-mix(in srgb, var(--color-text) 16%, transparent);
	--line-2: color-mix(in srgb, var(--color-text) 40%, transparent);
	--muted: color-mix(in srgb, var(--color-text) 68%, var(--color-bg));
	--accent-ink: color-mix(in srgb, var(--color-accent) 78%, var(--color-text));
	--r: min(var(--radius), 6px);
	--wrap: 1200px;
	--pad: clamp(18px, 5vw, 64px);
	--gap: clamp(24px, 3.4vw, 56px);
}

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

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

body {
	margin: 0;
	background: var(--color-bg);
	color: var(--color-text);
	font-family: var(--font-base);
	font-size: 17px;
	line-height: 1.7;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, p, ul, ol, blockquote, figure, table { margin: 0; padding: 0; }
ul, ol { list-style: none; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-ink); }

::selection { background: var(--color-accent); color: var(--color-bg); }

:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }

.skip {
	position: absolute; left: -9999px; top: 0; z-index: 50;
	padding: 12px 18px; background: var(--color-text); color: var(--color-bg);
	font-family: var(--font-mono); font-size: 12px;
}
.skip:focus { left: 0; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--pad); }

/* типографика */

.kick {
	display: flex; align-items: center; gap: 12px;
	font-family: var(--font-mono); font-size: 11px; font-weight: 500;
	letter-spacing: .2em; text-transform: uppercase;
	color: var(--accent-ink);
}
.kick i { display: block; width: clamp(28px, 6vw, 72px); height: 1px; background: currentColor; opacity: .5; flex: none; }

.sh { margin-bottom: clamp(30px, 4vw, 58px); }
.sh__t {
	margin-top: 18px;
	font-size: clamp(28px, 4.4vw, 54px);
	font-weight: 400; line-height: 1.06; letter-spacing: -.02em;
	max-width: 28ch; text-wrap: pretty;
}

.prose p { max-width: 68ch; margin-bottom: 1.15em; text-wrap: pretty; hyphens: auto; }
.prose p:last-child { margin-bottom: 0; }

.prose--drop > p:first-child::first-letter {
	float: left;
	font-size: 4.2em; line-height: .8;
	padding: .06em .1em 0 0;
	color: var(--accent-ink);
}

/* секции */

.sec { padding-block: clamp(56px, 8vw, 118px); scroll-margin-top: 76px; }
.sec + .sec { border-top: 1px solid var(--line); }
.sec--hero { padding-top: clamp(40px, 6vw, 78px); }
.sec--seo { font-size: 15.5px; }

/* шапка */

.hdr {
	position: sticky; top: 0; z-index: 30;
	background: var(--color-bg);
	border-bottom: 1px solid var(--line);
}
.hdr__in { display: flex; align-items: center; gap: 20px; min-height: 68px; }
.hdr__logo { font-size: clamp(18px, 2.4vw, 23px); letter-spacing: -.01em; margin-right: auto; }
.hdr__nav { display: flex; align-items: center; gap: clamp(16px, 2.2vw, 32px); }
.hdr__link {
	font-family: var(--font-mono); font-size: 11.5px;
	letter-spacing: .12em; text-transform: uppercase;
	padding-block: 6px; border-bottom: 1px solid transparent;
}
.hdr__link:hover { border-bottom-color: var(--color-accent); }
.hdr__link--cta { display: none; }
.hdr__cta {
	font-family: var(--font-mono); font-size: 11.5px;
	letter-spacing: .12em; text-transform: uppercase;
	padding: 10px 16px; border: 1px solid var(--line-2); border-radius: var(--r);
	white-space: nowrap;
}
.hdr__cta:hover { border-color: var(--color-accent); color: var(--accent-ink); }

.burger {
	display: none; width: 46px; height: 46px; flex: none;
	background: none; border: 0; padding: 12px; cursor: pointer;
}
.burger span { display: block; height: 1px; background: var(--color-text); margin: 5px 0; transition: transform .25s, opacity .2s; }

/* кнопки */

.btn {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 52px; padding: 14px 30px;
	font-family: var(--font-mono); font-size: 12.5px;
	letter-spacing: .14em; text-transform: uppercase;
	border-radius: var(--r); border: 1px solid transparent;
	cursor: pointer; transition: background-color .2s, color .2s, border-color .2s;
}
.btn--primary, .cta__call {
	background: var(--color-text); color: var(--color-bg); border-color: var(--color-text);
}
.btn--primary:hover, .cta__call:hover {
	background: color-mix(in srgb, var(--color-text) 78%, var(--color-accent));
	color: var(--color-bg);
	border-color: transparent;
}
/* ссылка-звонок, которой генератор подменяет форму без Telegram-бота */
.cta__call {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 52px; padding: 14px 30px; margin-top: 10px;
	font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase;
	border-radius: var(--r); border: 1px solid var(--color-text);
}
.btn--ghost { border-color: var(--line-2); }
.btn--ghost:hover { border-color: var(--color-accent); color: var(--accent-ink); }

/* герой */

.hero { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, .85fr); gap: var(--gap); align-items: end; }
.hero:not(:has(.hero__fig)) { grid-template-columns: minmax(0, 1fr); }
.hero__t {
	margin: 20px 0 22px;
	font-size: clamp(38px, 7vw, 84px);
	font-weight: 400; line-height: 1.02; letter-spacing: -.03em;
	max-width: 20ch; text-wrap: balance;
}
.hero__s { font-size: clamp(16px, 1.5vw, 19px); color: var(--muted); max-width: 46ch; text-wrap: pretty; }
.hero__acts { display: flex; flex-wrap: wrap; gap: 14px; margin-top: clamp(26px, 3vw, 40px); }
.hero__fig { border-top: 1px solid var(--line-2); padding-top: 14px; }
.hero__fig img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--r); }
.hero__fig figcaption {
	margin-top: 10px; font-family: var(--font-mono); font-size: 11px;
	letter-spacing: .06em; color: var(--muted);
}
.kick--hero i { width: clamp(20px, 4vw, 46px); }

/* о нас */

.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 250px); gap: var(--gap); }
.stats { display: flex; flex-direction: column; }
.stat { padding: 20px 0 22px; border-top: 1px solid var(--line); }
.stat:first-child { border-top-color: var(--line-2); }
.stat__v { display: block; font-size: clamp(30px, 4vw, 46px); line-height: 1; letter-spacing: -.03em; }
.stat__l { display: block; margin-top: 8px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* сетки карточек: 6 / 9 / 12 ложатся одинаково */

/* линейки рисуются фоном сетки в зазорах: внешних границ не появляется
   ни при 6, ни при 9, ни при 12 элементах, ни при переносе строк */
.grid { display: grid; gap: 1px; background: var(--line); border-top: 1px solid var(--line-2); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(21rem, 1fr)); }

.card, .case, .quote {
	background: var(--color-bg);
	padding: 26px clamp(18px, 2vw, 30px) 30px;
}
.card__n {
	display: block; margin-bottom: 16px;
	font-family: var(--font-mono); font-size: 12px; letter-spacing: .14em;
	color: var(--accent-ink);
}
.card__t { font-size: 19px; font-weight: 400; line-height: 1.25; letter-spacing: -.01em; margin-bottom: 10px; }
.card__x { font-size: 14.5px; line-height: 1.72; color: var(--muted); text-wrap: pretty; }

/* услуги: прайс-строки, а не карточки */

.list { border-top: 1px solid var(--line-2); }
.row {
	display: grid; grid-template-columns: 3rem minmax(0, 1fr) minmax(0, 1.25fr) auto;
	gap: clamp(14px, 2vw, 32px); align-items: baseline;
	padding: 22px 0 24px; border-bottom: 1px solid var(--line);
	transition: background-color .2s;
}
.row:hover { background: var(--color-surface); }
.row__n { font-family: var(--font-mono); font-size: 12px; color: var(--accent-ink); }
.row__t { font-size: 20px; font-weight: 400; line-height: 1.25; letter-spacing: -.01em; }
.row__x { font-size: 14.5px; line-height: 1.7; color: var(--muted); text-wrap: pretty; }
.row__p { font-size: 18px; white-space: nowrap; letter-spacing: -.01em; }

/* этапы */

.steps { border-top: 1px solid var(--line-2); }
.step {
	display: grid; grid-template-columns: clamp(3.4rem, 7vw, 6rem) minmax(0, 1fr) minmax(0, 1.5fr);
	gap: clamp(14px, 2vw, 32px); align-items: start;
	padding: 26px 0 28px; border-bottom: 1px solid var(--line);
}
.step__n { font-size: clamp(26px, 3.4vw, 40px); line-height: 1; letter-spacing: -.03em; color: var(--accent-ink); }
.step__t { font-size: 20px; font-weight: 400; line-height: 1.3; letter-spacing: -.01em; }
.step__x { font-size: 15px; line-height: 1.72; color: var(--muted); text-wrap: pretty; }

/* кейсы */

.case .kick { margin-bottom: 18px; }
.case__r { font-size: clamp(28px, 3.6vw, 42px); line-height: 1.05; letter-spacing: -.03em; }
.case__t { margin: 14px 0 10px; font-size: 18px; font-weight: 400; line-height: 1.3; }
.case__x { font-size: 14.5px; line-height: 1.72; color: var(--muted); text-wrap: pretty; }

/* отзывы */

.quote { display: flex; flex-direction: column; gap: 20px; }
.quote blockquote { font-size: 16px; line-height: 1.72; text-wrap: pretty; }
.quote blockquote::before { content: '«'; color: var(--accent-ink); }
.quote blockquote::after { content: '»'; color: var(--accent-ink); }
.quote figcaption { margin-top: auto; padding-top: 6px; border-top: 1px solid var(--line); }
.quote__n { display: block; font-size: 16px; }
.quote__r { display: block; font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* галерея: 5 картинок, редакторская мозаика */

.gal { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(10px, 1.4vw, 20px); }
.gal__i { display: flex; flex-direction: column; gap: 8px; }
.gal__i img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--r); }
.gal__i figcaption { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; color: var(--muted); }
.gal__i--1 { grid-column: span 2; grid-row: span 2; }
.gal__i--1 img { aspect-ratio: 1 / 1; }
.gal__i img { aspect-ratio: 4 / 3; }

/* ошибки / советы */

.duo { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); border-top: 1px solid var(--line-2); }
.duo__c { padding: clamp(20px, 2.4vw, 34px) clamp(18px, 2vw, 32px); }
.duo__c--tip { background: var(--color-surface); border-left: 1px solid var(--line); }
.duo__i + .duo__i { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--line); }
.duo__t { display: flex; gap: 12px; font-size: 18px; font-weight: 400; line-height: 1.3; letter-spacing: -.01em; }
.duo__m { font-family: var(--font-mono); flex: none; width: 1.2em; text-align: center; color: var(--accent-ink); }
.duo__c--tip .duo__m { color: var(--color-text); }
.duo__x { margin-top: 8px; padding-left: 2.2em; font-size: 14.5px; line-height: 1.7; color: var(--muted); text-wrap: pretty; }

/* таблицы: цены и сравнение */

.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
	padding: 0 16px 12px 0; text-align: left; font-weight: 400;
	font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
	color: var(--muted); border-bottom: 1px solid var(--line-2); white-space: nowrap;
}
.tbl td { padding: 15px 16px 15px 0; font-size: 15px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl td:first-child { font-size: 16.5px; }
.tbl tbody tr:hover { background: var(--color-surface); }
.tbl th.is-us, .tbl td.is-us { background: var(--color-surface); padding-inline: 16px; }
.tbl th.is-us { color: var(--accent-ink); }

/* FAQ */

.faq { border-top: 1px solid var(--line-2); }
.faq__i { border-bottom: 1px solid var(--line); }
.faq__q {
	display: flex; gap: clamp(12px, 2vw, 26px); align-items: baseline;
	padding: 22px 44px 22px 0; position: relative; cursor: pointer;
	font-size: clamp(17px, 1.8vw, 21px); line-height: 1.35; letter-spacing: -.01em;
	list-style: none;
}
.faq__q::-webkit-details-marker { display: none; }
.faq__q::after {
	content: '+'; position: absolute; right: 0; top: 20px;
	font-family: var(--font-mono); font-size: 20px; line-height: 1; color: var(--accent-ink);
}
.faq__i[open] .faq__q::after { content: '\2013'; }
.faq__n { font-family: var(--font-mono); font-size: 12px; color: var(--accent-ink); flex: none; }
.faq__a { padding: 0 44px 26px clamp(12px, 2vw, 26px); }
.faq__a p { font-size: 15.5px; line-height: 1.75; color: var(--muted); max-width: 76ch; text-wrap: pretty; }
.faq__i[open] .faq__a { animation: fade .25s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(-4px); } }

/* SEO-текст */

.prose--cols { columns: 2; column-gap: clamp(28px, 4vw, 62px); }
.prose--cols p { max-width: none; font-size: 15px; line-height: 1.78; color: var(--muted); }

/* заявка */

.cta { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: var(--gap); align-items: start; }
.cta__t { margin: 18px 0 16px; font-size: clamp(28px, 4.4vw, 52px); font-weight: 400; line-height: 1.05; letter-spacing: -.025em; max-width: 22ch; text-wrap: balance; }
.cta__s { color: var(--muted); max-width: 44ch; text-wrap: pretty; }
.cta__form { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--line-2); padding-top: 10px; }
.cta__input {
	width: 100%; min-height: 54px; padding: 14px 2px;
	font: inherit; font-size: 16px; color: var(--color-text);
	background: transparent; border: 0; border-bottom: 1px solid var(--line);
	border-radius: 0;
}
.cta__input::placeholder { color: var(--muted); opacity: .85; }
.cta__input:focus { outline: none; border-bottom-color: var(--color-accent); }
.cta__input:focus-visible { outline: none; }
.cta__form .btn { margin-top: 22px; width: 100%; }
.cta__privacy { margin-top: 14px; font-family: var(--font-mono); font-size: 11px; line-height: 1.6; letter-spacing: .04em; color: var(--muted); }
.cta__msg:not(:empty) {
	margin-top: 14px; padding: 12px 16px;
	font-size: 14px; border-left: 2px solid var(--color-accent); background: var(--color-surface);
}
.cta__msg.is-err { border-left-color: color-mix(in srgb, var(--color-text) 60%, var(--color-accent)); }

/* подвал */

.ftr { border-top: 1px solid var(--line-2); padding-top: clamp(40px, 5vw, 66px); }
.ftr__in { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.ftr__logo { font-size: 21px; letter-spacing: -.01em; margin-bottom: 12px; }
.ftr__x { font-size: 14.5px; line-height: 1.7; color: var(--muted); max-width: 46ch; text-wrap: pretty; }
.ftr__h { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 16px; }
.ftr__l li { padding: 7px 0; font-size: 15px; border-bottom: 1px solid var(--line); }
.ftr__b { margin-top: clamp(34px, 4vw, 54px); padding-block: 22px; border-top: 1px solid var(--line); }
.ftr__b p { font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; color: var(--muted); }

/* адаптив */

@media (max-width: 1000px) {
	.hero { grid-template-columns: 1fr; align-items: start; }
	.hero__fig img { aspect-ratio: 16 / 10; }
	.about { grid-template-columns: 1fr; }
	.stats { flex-direction: row; gap: clamp(14px, 3vw, 30px); }
	.stat { flex: 1; }
	.step { grid-template-columns: clamp(3rem, 8vw, 4.5rem) minmax(0, 1fr); }
	.step__x { grid-column: 2; }
	.cta { grid-template-columns: 1fr; }
	.ftr__in { grid-template-columns: 1fr 1fr; }
	.ftr__c--about { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
	.hdr__nav {
		position: fixed; inset: 0; z-index: 40;
		flex-direction: column; align-items: flex-start; justify-content: center;
		gap: 4px; padding: 84px var(--pad) 40px;
		background: var(--color-bg);
		transform: translateX(100%); transition: transform .3s ease;
		overflow-y: auto;
	}
	.hdr__nav.is-open { transform: none; }
	.hdr__link {
		width: 100%; padding: 16px 0; border-bottom: 1px solid var(--line);
		font-family: var(--font-base); font-size: clamp(21px, 5.5vw, 30px);
		letter-spacing: -.02em; text-transform: none;
	}
	.hdr__link--cta { display: block; color: var(--accent-ink); }
	.hdr__cta { display: none; }
	.burger { display: block; position: relative; z-index: 41; }
	body.nav-open { overflow: hidden; }
	body.nav-open .burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
	body.nav-open .burger span:nth-child(2) { opacity: 0; }
	body.nav-open .burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

	.row { grid-template-columns: 2.2rem minmax(0, 1fr); row-gap: 8px; }
	.row__x { grid-column: 2; }
	.row__p { grid-column: 2; font-size: 17px; color: var(--accent-ink); }
	.gal { grid-template-columns: repeat(2, 1fr); }
	.gal__i--1 { grid-column: span 2; grid-row: auto; }
	.gal__i--1 img, .gal__i img { aspect-ratio: 3 / 2; }
	.prose--cols { columns: 1; }
	.duo__c--tip { border-left: 0; border-top: 1px solid var(--line); }
}

@media (max-width: 680px) {
	body { font-size: 16px; }
	.prose--drop > p:first-child::first-letter { font-size: 3.4em; }

	/* таблицы разворачиваются в карточки */
	.tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
	.tbl thead { display: none; }
	.tbl tr { border-bottom: 1px solid var(--line-2); padding-block: 6px 12px; }
	.tbl tbody tr:hover { background: none; }
	.tbl td { border-bottom: 1px solid var(--line); padding: 9px 0; font-size: 15px; }
	.tbl td:not(:first-child) { display: grid; grid-template-columns: 42% 1fr; gap: 12px; align-items: baseline; }
	.tbl td:last-child { border-bottom: 0; }
	.tbl td.is-us { background: none; padding-inline: 0; }
	.tbl td::before {
		content: attr(data-l); display: block;
		font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em; line-height: 1.5;
		text-transform: uppercase; color: var(--muted);
	}
	.tbl td:first-child::before { margin-bottom: 3px; }
	.tbl td:first-child::before { color: var(--accent-ink); }
	.tbl td.is-us::before { color: var(--accent-ink); }

	.stats { flex-direction: column; }
	.ftr__in { grid-template-columns: 1fr; }
	.faq__q { padding-right: 34px; }
	.faq__a { padding-right: 0; }
}

@media (max-width: 400px) {
	.gal { grid-template-columns: 1fr; }
	.gal__i--1 { grid-column: auto; }
	.btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

@media print {
	.hdr, .burger, .cta__form, .skip { display: none; }
	body { font-size: 12pt; }
}

/* === Custom overrides === */
:root {
	--color-bg: #f6f0e4;
	--color-surface: #fff8ec;
	--color-text: #2b241d;
	--color-accent: #c0652a;
	--font-base: 'Libre Baskerville', system-ui, sans-serif;
	--radius: 12px;
}
