/* КАТРИ — трикотажная фабрика. Основные стили. */

@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope-cyrillic-wght-normal.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2122, U+2191, U+2193, U+2212, U+2215;
}

/* Дисплейный сериф: заголовки и цифры. Одно начертание, только 400. */
@font-face {
  font-family: "Prata";
  src: url("../fonts/prata-cyrillic-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Prata";
  src: url("../fonts/prata-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2122, U+2191, U+2193, U+2212, U+2215;
}

:root {
  --bg: #fbf8f3;
  --bg-alt: #efe6d8;
  --card: #ffffff;
  --ink: #221f1c;
  --muted: #5c554c;
  --line: #e0d6c7;
  --accent: #8f2f26;
  --accent-dark: #71241d;
  --accent-soft: #f6e7e3;
  --terracotta: #c8452f;
  --terracotta-ink: #fff;
  --ink-soft: #f3ede4;
  --ink-muted: #c9bfb2;
  --accent-light: #e8a49a;
  --line-dark: rgba(255,255,255,.14);
  --card-dark: rgba(255,255,255,.06);
  --focus: #1a4f8a;
  --radius: 0;
  --radius-btn: 999px;
  --radius-field: 8px;
  --hdr-h: 64px;
  --wrap: 1200px;
  --gutter: 16px;
  /* Отступ от края окна до колонки .wrap: им выравниваем текст полноширинных блоков. */
  --edge: calc((100vw - min(100vw, var(--wrap))) / 2 + var(--gutter));
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Prata", Georgia, "Times New Roman", serif;
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}

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

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

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

/* На тёмном фоне и поверх фото синяя рамка почти не читается — там она белая. */
.sec--dark :focus-visible, .ftr :focus-visible, .lb :focus-visible,
.phead :focus-visible, .js .hdr:not(.hdr--solid) :focus-visible { outline-color: #fff; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; }
/* Заголовки и цифры — серифом. Prata сама широкая, отрицательный трекинг ей не нужен. */
h1, h2, .num, .stat b {
  font-family: var(--font-display); font-weight: 400;
  letter-spacing: 0; line-height: 1.05;
}
h1 { font-size: 2.2rem; max-width: 18ch; }
h2 { font-size: 1.9rem; max-width: 18ch; margin-bottom: .5em; }
h3 { font-size: 1.1rem; letter-spacing: -.01em; }
p { margin: 0 0 1em; }

/* Ярлык раздела над заголовком — как «О компании» у ориентиров. */
.sec__label {
  font-family: var(--font); font-weight: 700; font-size: .8rem;
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--accent); margin: 0 0 12px;
}
.sec--dark .sec__label, .phead .sec__label { color: var(--accent-light); }

.icons { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { flex: none; vertical-align: middle; }

.vh {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--accent); color: #fff; padding: 10px 16px;
}
.skip:focus { left: 0; }

/* Сторож для шапки: пока он в кадре, шапка прозрачная. В потоке не участвует. */
.hdr-sentinel { position: absolute; top: 0; left: 0; width: 1px; height: 40px; }

/* --- Контейнеры и секции --- */

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.wrap--narrow { max-width: 860px; }

.sec {
  padding: 40px 0;
  scroll-margin-top: calc(var(--hdr-h) + 8px);
}
.sec--alt { background: var(--bg-alt); }
.sec.sec--hero { padding: 0; overflow: clip; }
/* Секция начинается полноширинным фото — сверху отступ не нужен. */
.sec--flush { padding-top: 0; }

/* Тёмная полоса: ритм страницы, минимум три раза сверху вниз. */
.sec--dark { background: var(--ink); color: var(--ink-soft); }
.sec--dark h2, .sec--dark h3 { color: #fff; }
.sec--dark .card { background: var(--card-dark); color: var(--ink-soft); }
.sec--dark .card h3 { color: var(--accent-light); }
.sec--dark .lead, .sec--dark .note, .sec--dark p { color: var(--ink-muted); }
.sec--dark .card p { color: var(--ink-soft); }
.sec--dark .btn--ghost { color: #fff; border-color: rgba(255,255,255,.55); }
.sec--dark .btn--ghost:hover { background: rgba(255,255,255,.1); color: #fff; }
.sec--dark a:not(.btn) { color: var(--accent-light); }
.sec--dark .ticks li::before { background: var(--accent-light); }

/* Хвост страницы: «Работаем с юрлицами» и «Приезжайте» — одна тёмная полоса. */
.sec.sec--pair-top { padding-bottom: 40px; }
.sec--pair-top p { max-width: 72ch; }

.lead { font-size: 1.12rem; color: var(--muted); max-width: 62ch; }
.note { font-size: .88rem; color: var(--muted); }

/* --- Кнопки --- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 26px; border-radius: var(--radius-btn); border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: .95rem; text-decoration: none; cursor: pointer;
  min-height: 46px; text-align: center;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-dark); color: #fff; }
.btn--ghost { background: transparent; color: var(--accent); border-color: currentColor; }
.btn--ghost:hover { background: var(--accent-soft); color: var(--accent-dark); }
.btn--big { padding: 15px 30px; font-size: 1.02rem; }
.btn[disabled] { opacity: .6; cursor: default; }

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 8px; }
/* На узком экране кнопка занимает всю ширину — попасть пальцем проще. */
.cta-row .btn { width: 100%; }

/* --- Шапка --- */

.hdr {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  /* backdrop-filter здесь нельзя: он делает шапку containing block
     для position: fixed, и панель бургера перестаёт раскрываться на весь экран. */
}
/* Над первым экраном — прозрачная поверх фото; после прокрутки 40 px — плотная.
   Без JS класса .hdr--solid никто не снимет, поэтому шапка всегда плотная. */
.js .hdr {
  /* Прозрачная — но с лёгкой затемняющей вуалью: под шапкой всегда фото,
     без неё белые буквы теряются на светлых кадрах. */
  background: linear-gradient(180deg, rgba(20,17,15,.62), rgba(20,17,15,.5) 55%, rgba(20,17,15,0));
  border-bottom-color: transparent;
}
.js .hdr--solid { background: var(--bg); border-bottom-color: var(--line); }
.js .hdr:not(.hdr--solid) .hdr__brand,
.js .hdr:not(.hdr--solid) .hdr__tel { color: #fff; }
.js .hdr:not(.hdr--solid) .hdr__brand-sub,
.js .hdr:not(.hdr--solid) .hdr__tel-note { color: rgba(255,255,255,.82); }
.js .hdr:not(.hdr--solid) .hdr__burger { color: #fff; border-color: rgba(255,255,255,.5); }
.js .hdr:not(.hdr--solid) .hdr__cta { background: #fff; color: var(--ink); }
.js .hdr:not(.hdr--solid) .hdr__cta:hover { background: var(--ink-soft); }

.hdr__in {
  max-width: var(--wrap); margin: 0 auto; padding: 0 12px;
  min-height: var(--hdr-h);
  display: flex; align-items: center; gap: 10px;
}
.hdr__brand {
  font-family: var(--font-display); font-weight: 400; color: var(--ink);
  text-decoration: none; font-size: 1.25rem; letter-spacing: .06em;
  line-height: 1.15; margin-right: auto;
}
.hdr__brand-sub {
  display: none; color: var(--muted); font-family: var(--font); font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em;
}

/* На мобайле в ссылке остаётся одна иконка — min-width держит палец. */
.hdr__tel { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 40px; text-decoration: none; color: var(--ink); font-weight: 700; }
.hdr__tel:hover { color: var(--accent); }
.hdr__tel-txt { display: flex; flex-direction: column; }
.hdr__tel-num { display: none; white-space: nowrap; font-size: .9rem; }
.hdr__tel-note { display: none; font-size: .72rem; font-weight: 500; color: var(--muted); }

.hdr__wa {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  color: #fff; background: #1fa855; text-decoration: none; flex: none;
}
.hdr__wa:hover { background: #17853f; color: #fff; }

.hdr__cta { display: none; padding: 10px 18px; min-height: 40px; white-space: nowrap; }

.hdr__burger {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; padding: 0;
  background: transparent; border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink); cursor: pointer;
}

.hdr__nav {
  position: fixed; inset: 0; z-index: 110;
  background: var(--bg);
  padding: 20px 16px 32px;
  display: none; flex-direction: column; gap: 4px;
  overflow-y: auto;
}
.hdr__nav.is-open { display: flex; }
.hdr__nav a {
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: .9rem;
  padding: 12px 4px; border-bottom: 1px solid var(--line);
}
.hdr__nav a:hover { color: var(--accent); }
.hdr__nav-cta { color: #fff !important; border-bottom: 0 !important; margin-bottom: 12px; }
.hdr__nav-close {
  align-self: flex-end; width: 42px; height: 42px; padding: 0;
  background: transparent; border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink); cursor: pointer; margin-bottom: 8px;
}

/* --- Первый экран --- */

.hero { position: relative; display: grid; }
.hero__pic { order: -1; height: 60vh; }
.hero__pic picture { display: block; height: 100%; }
.hero__pic img {
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%;
}
.hero__text {
  position: relative; z-index: 1; background: var(--bg);
  padding: 28px var(--gutter) 32px;
}
.hero__sub { color: var(--muted); font-size: .98rem; max-width: 40ch; }
.hero .cta-row { margin-top: 22px; }

.slogan {
  font-style: italic; color: var(--muted); font-size: 1rem;
  border-left: 3px solid var(--accent); padding-left: 12px;
}

/* Цифры-факты: полоса под первым экраном, без коробочек. */
.stats-band { background: var(--bg); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, 1fr);
}
.stat { padding: 22px 14px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.stats > .stat:nth-child(-n+2) { border-top: 0; }
.stats > .stat:nth-child(2n+1) { border-left: 0; padding-left: 0; }
.num { display: block; color: var(--accent); font-size: 2.4rem; margin-bottom: 6px; }
.stat span { display: block; font-size: .86rem; color: var(--muted); max-width: 22ch; }

/* --- Колонки, карточки, списки --- */

.cols { display: grid; gap: 20px; }
.cols__side { align-self: start; }

.card { background: var(--card); border: 0; border-radius: var(--radius); padding: 24px; }
.card p:last-child { margin-bottom: 0; }
.card--accent { background: var(--accent-soft); }
/* Плоская плитка терракотой — акцент в сетках. */
.card--fill, .sec--dark .card--fill { background: var(--terracotta); color: var(--terracotta-ink); }
.card--fill h3, .sec--dark .card--fill h3 { color: #fff; }
.card--fill p, .sec--dark .card--fill p { color: rgba(255,255,255,.85); }
.card--promise h3 { color: var(--accent); }
.sec--dark .card--promise h3 { font-family: var(--font-display); font-weight: 400; font-size: 1.4rem; }

.cards { display: grid; gap: 12px; margin: 18px 0; }

/* --- Фото в текстовых секциях --- */

/* Полоса фото под заголовком: три в ряд, без рамок. */
.strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 24px; }
.wrap > .strip:last-child { margin-bottom: 0; }
#novyi-god .strip img { aspect-ratio: 1; }
.strip img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: 50% 15%; }

/* --- Полоса «текст + фото до края экрана» --- */

.band { padding: 0; display: grid; }
.band__pic { order: -1; height: 56vw; }
.band__pic picture { display: block; height: 100%; }
.band__pic img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }
.band__text { padding: 32px var(--gutter) 36px; }
.band__text > h2, .band__text > p, .band__text > ul, .band__text > .card { max-width: 56ch; }
.band__text .card { background: var(--card); margin-top: 8px; }
.sec--alt .band__text .card { background: var(--bg); }

.ticks { list-style: none; margin: 0 0 1em; padding: 0; }
.ticks li { position: relative; padding-left: 26px; margin-bottom: 8px; }
.ticks li::before {
  content: ""; position: absolute; left: 4px; top: .6em;
  width: 6px; height: 6px; background: var(--accent);
}

/* --- CTA-полоса «Рассчитать тираж» --- */

.cta-band { padding: 44px 0; }
.cta-band h2 { font-size: 2rem; max-width: none; margin-bottom: .3em; }
.cta-band .lead { max-width: 46ch; }
.cta-band .cta-row { margin: 20px 0 6px; }
.cta-band__in { display: grid; gap: 18px; }

/* --- Плашка-дедлайн --- */

.deadline {
  background: var(--terracotta); color: #fff; border-radius: var(--radius);
  padding: 24px; margin: 0 0 22px; max-width: 56ch;
}
.deadline__ttl { font-weight: 700; font-size: 1.05rem; margin: 0 0 10px; }
.deadline__tbl { width: 100%; border-collapse: collapse; }
.deadline__tbl th, .deadline__tbl td { text-align: left; padding: 8px 6px; border-top: 1px solid rgba(255,255,255,.35); }
.deadline__tbl thead th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; border-top: 0; opacity: .85; }
.deadline__tbl tbody td { font-size: 1.15rem; font-weight: 700; }

/* --- Сроки и объёмы: числа вместо карточек --- */

.case { background: transparent; border: 0; padding: 0; }
.case h3 { font-size: 1rem; font-weight: 700; line-height: 1.35; margin-bottom: .4em; }
.case .num { font-size: 2.6rem; margin-bottom: 4px; }
.case p { color: var(--muted); font-size: .92rem; margin-bottom: 0; }

/* --- Этапы --- */

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.step {
  display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: start;
  padding: 18px 0; border-top: 1px solid var(--line);
}
.step:first-child { border-top: 0; }
.step__n {
  font-family: var(--font-display); font-weight: 400; font-size: 2.4rem;
  line-height: 1; color: var(--accent);
}
.step h3 { margin-bottom: .25em; }
.step p { margin: 0; color: var(--muted); }

/* --- FAQ --- */

.faq details { background: transparent; border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; padding: 16px 0; font-weight: 700; font-size: 1.05rem; list-style: none;
  display: flex; justify-content: space-between; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq__a { padding: 0 0 12px; color: var(--muted); }

/* --- Галерея --- */

.gal {
  list-style: none; margin: 0 0 24px; padding: 0;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}
.gal__i {
  display: block; width: 100%; padding: 0; border: 1px solid var(--line);
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  cursor: pointer; font: inherit; color: var(--ink); text-align: left;
}
.gal__i img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.gal__i:hover { border-color: var(--accent); }
.gal__cap { display: block; padding: 8px 10px; font-size: .82rem; color: var(--muted); }

/* Мозаика изделий: крупно, без рамок и подписей — подпись остаётся в alt и в лайтбоксе. */
.gal--mosaic { grid-template-columns: repeat(2, 1fr); gap: 8px; grid-auto-rows: 44vw; }
.gal--mosaic > li { min-width: 0; }
.gal--mosaic .gal__i { height: 100%; border: 0; background: none; }
.gal--mosaic .gal__i img { height: 100%; aspect-ratio: auto; transition: transform .3s; }
.gal--mosaic .gal__i:hover img { transform: scale(1.02); }
.gal--mosaic .gal__cap { display: none; }
/* Ярлык группы внутри мозаики — не заголовок-сериф, а мелкая надпись над сеткой. */
.gal-group { margin-top: 4px; }

/* Награды и публикации: документ нельзя кропать — вписываем целиком. */
.gal--5 .gal__i img { object-fit: contain; background: var(--bg-alt); }
/* Подписи к документам длинные и разной длины: режем до трёх строк,
   чтобы плитки не разъезжались. Полный текст — в лайтбоксе. */
.gal--5 .gal__cap {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  /* Нижний отступ — полем, а не padding: overflow режет по padding-box,
     и четвёртая строка выглядывала бы в нижний отступ. */
  padding-bottom: 0; margin-bottom: 8px;
}

/* Свёртка галереи: без скрипта видны все карточки, кнопка не нужна. */
.js .gal--collapsed .gal__i-more { display: none; }
.gal-more { display: none; margin-top: 8px; }
.js .gal-more { display: flex; }
.js .gal-more.is-hidden { display: none; }

.lb {
  border: 0; padding: 0; max-width: 100vw; max-height: 100vh; width: 100%; height: 100%;
  background: rgba(20, 17, 15, .94); color: #fff;
}
.lb::backdrop { background: rgba(20, 17, 15, .8); }
.lb__fig { margin: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 32px 12px; }
.lb__img { max-width: 100%; max-height: calc(100vh - 80px); object-fit: contain; }
.lb__cap { font-size: .9rem; color: #e8e2da; text-align: center; }
.lb__close, .lb__nav {
  position: absolute; z-index: 2; width: 46px; height: 46px; padding: 0;
  background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.35); border-radius: 50%;
  color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.lb__close { top: 10px; right: 10px; }
.lb__nav { top: 50%; transform: translateY(-50%); }
.lb__nav--prev { left: 10px; }
.lb__nav--prev svg { transform: rotate(180deg); }
.lb__nav--next { right: 10px; }

/* --- Полоса «Наше производство» --- */

.phead { position: relative; }
.phead__pic { display: block; }
.phead__pic img { width: 100%; height: 50vh; object-fit: cover; object-position: 50% 45%; }
.phead__over {
  position: absolute; inset: 0; display: flex; align-items: flex-end; color: #fff;
  background: linear-gradient(180deg, rgba(20,17,15,.55), rgba(20,17,15,.15) 40%, rgba(20,17,15,.65));
}
.phead__in { padding-bottom: 24px; padding-top: 24px; }
.phead h2 { color: #fff; margin-bottom: .3em; }
.phead + .wrap { padding-top: 40px; }
.phead .lead { color: #fff; max-width: 52ch; margin-bottom: 0; }

/* --- Попап «Узнать стоимость» / «Запросить КП» --- */

.modal {
  border: 0; padding: 0; background: transparent; color: var(--ink);
  width: 100%; height: 100%; max-width: 100vw; max-height: 100vh;
}
/* display задаём только открытому: иначе авторское правило перебивает
   браузерное dialog:not([open]) { display: none } и закрытый попап
   остаётся видимым внизу страницы. */
.modal[open] { display: flex; }
.modal::backdrop { background: rgba(20, 17, 15, .6); }
html.is-modal { overflow: hidden; }
.modal__box {
  background: var(--card); border-radius: var(--radius); padding: 24px;
  width: min(100vw - 24px, 480px); margin: auto 12px 12px; position: relative;
  max-height: calc(100vh - 24px); overflow: auto;
}
/* В попапе поля всегда в одну колонку, как бы ни был широк экран. */
.modal .form__grid { grid-template-columns: 1fr; }
.modal__ttl { font-size: 1.7rem; margin: 0 40px 8px 0; max-width: none; }
.modal__lead { margin: 0 0 18px; color: var(--muted); }
.modal__close {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 40px; height: 40px; padding: 0;
  background: transparent; border: 0; border-radius: 50%;
  color: var(--ink); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* --- Контакты и карта --- */

.contacts { list-style: none; margin: 0; padding: 0; }
.contacts li { margin-bottom: 10px; }
.lnk-wa { margin-left: 6px; }
.map { background: var(--bg-alt); border: 1px solid var(--line); overflow: hidden; min-height: 260px; }
.map iframe { display: block; width: 100%; height: 320px; border: 0; }

/* --- Форма --- */

.form { margin: 0 0 8px; }
.form__grid { display: grid; gap: 14px; }
.field { margin: 0; display: flex; flex-direction: column; gap: 6px; }
fieldset.field { border: 0; padding: 0; min-width: 0; }
.field label, .field legend { font-weight: 600; font-size: .9rem; padding: 0; }
.field input[type="text"], .field input[type="tel"], .field input[type="email"],
.field input[type="number"], .field select, .field textarea {
  font: inherit; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius-field); padding: 14px; width: 100%;
  min-height: 46px;
}
.field input[type="file"] { font: inherit; font-size: .9rem; }
.field textarea { min-height: 92px; resize: vertical; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { border-color: var(--focus); }
.hint { font-size: .82rem; color: var(--muted); }
.err { font-size: .84rem; color: var(--accent); font-weight: 600; }
.field.is-bad input, .field.is-bad select, .field.is-bad textarea { border-color: var(--accent); }

.radios { display: flex; flex-wrap: wrap; gap: 14px; }
.radio, .check { font-weight: 500; display: inline-flex; align-items: flex-start; gap: 8px; font-size: .95rem; }
.radio input, .check input { margin: 3px 0 0; width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.field--check { margin-top: 16px; }
.form__submit { margin: 16px 0 8px; }
.form__submit .btn { width: 100%; }
.form__error { background: var(--accent-soft); padding: 12px 14px; margin-top: 16px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form__done { background: var(--card); border-left: 5px solid #1fa855; padding: 18px; }
.form__done-ttl { font-weight: 700; }
.form__done-ttl .ic { color: #1fa855; }

/* --- Подвал --- */

.ftr { background: #221f1c; color: #ded6ca; padding: 28px 0; font-size: .92rem; }
.ftr a { color: #fff; margin-right: 14px; }
.ftr a:hover { color: #f0c9c2; }
.ftr p { margin: 0 0 8px; }
.ftr p:last-child { margin-bottom: 0; }

/* --- Брейкпоинты --- */

@media (min-width: 600px) {
  h1 { font-size: 3rem; }
  h2 { font-size: 2.4rem; }
  .sec { padding: 64px 0; }
  .hdr__brand { font-size: 1.5rem; }
  .cards--3, .cards--4 { grid-template-columns: repeat(2, 1fr); }
  .gal { grid-template-columns: repeat(3, 1fr); }
  .gal--mosaic { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 30vw; }
  .hdr__tel-num { display: inline; }
  .modal__box { margin: auto; }
  .form__submit .btn, .cta-row .btn { width: auto; }
}

@media (min-width: 900px) {
  :root { --gutter: 24px; }
  h1 { font-size: 2.6rem; }
  h2 { font-size: 2.6rem; }
  .sec { padding: 64px 0; }

  /* Первый экран: слева текст на кремовом, справа фото до края и под шапку. */
  .hero { min-height: 100vh; min-height: 100svh; grid-template-columns: 5fr 7fr; padding-top: var(--hdr-h); }
  .hero__pic { position: absolute; inset: 0; height: auto; z-index: 0; }
  .hero__pic img { object-position: 62% 12%; }
  .hero__text {
    grid-column: 1; display: flex; flex-direction: column; justify-content: center;
    padding: 48px 40px;
    /* Слева — как у .wrap. Ограничение 10vw нужно на широких экранах: колонка
       в 5/12 растёт медленнее, чем отступ .wrap, и текст иначе зажимался бы. */
    padding-left: min(var(--edge), 10vw);
  }
  .hero__sub { font-size: 1.1rem; }

  .stats { grid-template-columns: repeat(4, 1fr); }
  .stat { padding: 40px 24px; border-top: 0; border-left: 1px solid var(--line); }
  .stats > .stat:nth-child(2n+1) { border-left: 1px solid var(--line); padding-left: 24px; }
  .stats > .stat:first-child { border-left: 0; padding-left: 0; }
  .num { font-size: 3.6rem; }
  .stat span { font-size: .9rem; }

  .cols { grid-template-columns: 1.35fr .65fr; gap: 32px; }
  .cols--even { grid-template-columns: 1fr 1fr; }
  .strip { gap: 12px; margin-bottom: 32px; }
  .cards { gap: 14px; }
  .cards--3, .cards--4 { grid-template-columns: repeat(3, 1fr); }
  /* Четвёртая плитка в трёхколоннике идёт во всю ширину — дырки в сетке не остаётся. */
  .cards--4 > :nth-child(4) { grid-column: 1 / -1; }

  /* Полосы «текст + фото»: фото на всю высоту колонки и до края экрана. */
  .band { grid-template-columns: 1fr 1fr; align-items: stretch; }
  /* Фото тянется на высоту текстовой колонки, а не задаёт её: страница не растёт. */
  .band__pic { order: 0; grid-row: 1; position: relative; height: auto; min-height: 560px; }
  /* Фото полосы липнет к экрану, пока текст прокручивается: кадр не выше экрана,
     поэтому портрет кропится, а не показывается целиком с половиной лица сверху. */
  .band__pic picture { position: sticky; top: var(--hdr-h); height: calc(100vh - var(--hdr-h)); }
  #merch .band__pic img { object-position: 50% 58%; }
  .band__text {
    grid-row: 1; display: flex; flex-direction: column; justify-content: center;
    padding: 64px 40px;
  }
  .band--right .band__pic { grid-column: 2; }
  .band--right .band__text { grid-column: 1; padding-left: var(--edge); }
  .band--left .band__pic { grid-column: 1; }
  .band--left .band__text { grid-column: 2; padding-right: var(--edge); }

  .cta-band { padding: 56px 0; }
  .cta-band h2 { font-size: 2.4rem; }
  .cta-band__in { grid-template-columns: 1.1fr .9fr; align-items: center; gap: 32px; }
  .cta-band .cta-row { margin-top: 0; justify-content: flex-end; }
  .cta-band .note { text-align: right; margin-bottom: 0; }

  .phead__pic img { height: 70vh; }
  .phead__in { padding-bottom: 40px; }

  .case .num { font-size: 3.4rem; }
  .cards--3 .case { border-left: 1px solid var(--line); padding-left: 24px; }
  .cards--3 .case:first-child { border-left: 0; padding-left: 0; }

  .step { grid-template-columns: 84px 1fr; gap: 20px; padding: 22px 0; }
  .step__n { font-size: 3rem; }

  .gal { grid-template-columns: repeat(4, 1fr); }
  .gal--5 { grid-template-columns: repeat(3, 1fr); }
  .gal--mosaic { grid-template-columns: repeat(4, 1fr); gap: 12px; grid-auto-rows: 240px; grid-auto-flow: dense; }
  /* Шаг мозаики — шесть карточек: они ровно закрывают два ряда из четырёх колонок. */
  .gal--mosaic--big > li:nth-child(6n+1) { grid-row: span 2; }
  .gal--mosaic--big > li:nth-child(6n+2) { grid-column: span 2; }

  .form-sec__in { display: grid; grid-template-columns: 5fr 7fr; gap: 40px; align-items: start; }
  .form__grid { grid-template-columns: 1fr 1fr; }
  .field--wide { grid-column: 1 / -1; }
  .hdr__cta { display: inline-flex; }
  /* Блок заканчивается карточками — снизу столько воздуха не нужно. */
  #keysy, #etapy { padding-bottom: 48px; }
}

@media (min-width: 1200px) {
  h1 { font-size: 3rem; }
  h2 { font-size: 3rem; }
  .gal--5 { grid-template-columns: repeat(4, 1fr); }
  /* Подпись — второй строкой: в одну строку с меню, телефоном и кнопкой
     она не помещается (.hdr__in шире 1200 px не становится). */
  .hdr__brand-sub { display: block; font-size: .7rem; }
  .hdr__tel-note { display: block; }
  .hdr__burger { display: none; }
  .hdr__nav {
    position: static; display: flex; flex-direction: row; align-items: center;
    background: transparent; padding: 0; gap: 10px; overflow: visible; margin-right: auto;
  }
  .hdr__nav a { border-bottom: 0; padding: 6px 0; font-size: .82rem; font-weight: 600; white-space: nowrap; }
  .hdr__nav-cta, .hdr__nav-close { display: none; }
  .hdr__brand { margin-right: 20px; white-space: nowrap; }
  .js .hdr:not(.hdr--solid) .hdr__nav a { color: #fff; }
}


@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .gal--mosaic .gal__i img { transition: none; }
}
