/* Кинопериферия — редизайн по ТЗ: рабочий инструмент с площадки, а не
   модный журнал. Один гротеск на всё, моно — только для цифр, жёсткая
   шкала размеров и отступов, минимум декора и движения. */

/* ── Шрифты ──────────────────────────────────────────────────────────── */
/* Golos Text + IBM Plex Mono лежат рядом с сайтом (/static/fonts): из России
   Google Fonts отвечает медленно и блокирует первую отрисовку. unicode-range
   режет файлы по алфавитам — браузер качает только кириллицу и латиницу,
   которые реально есть на странице. Golos — вариативный: 400 и 500 в одном
   файле. Кириллица Golos предзагружается из base.gohtml. */
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/golos-text-cyrillic-ext.woff2") format("woff2"); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/golos-text-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/golos-text-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/golos-text-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/golos-text-cyrillic-ext.woff2") format("woff2"); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/golos-text-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/golos-text-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/golos-text-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-mono-400-cyrillic-ext.woff2") format("woff2"); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-mono-400-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-mono-400-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-mono-400-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-mono-500-cyrillic-ext.woff2") format("woff2"); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-mono-500-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-mono-500-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-mono-500-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  /* Цвет */
  --bg: #121212;
  --bg-raised: #1c1c1c;
  --paper: #ECEAE5;
  --text: #f2f0eb;
  --text-muted: #9a9892;
  --ink: #141414;
  --line: rgba(242, 240, 235, .12);
  --line-on-paper: rgba(20, 20, 20, .12);
  --accent: #f2c200;

  /* Шрифты */
  --font-main: "Golos Text", "Onest", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Шкала текста — desktop (≥ 1280px), см. таблицу в ТЗ */
  --fs-display: 88px;
  --fs-h2: 56px;
  --fs-h3: 28px;
  --fs-lead: 20px;
  --fs-body: 17px;
  --fs-small: 16px;
  --fs-label: 14px;

  /* Шкала отступов — шаг 8px */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --space-10: 128px;

  /* Сетка */
  --content-max: 1360px;
  --margin: 40px;
  --gutter: 24px;
  --section-pad: var(--space-10);
  --head-gap: var(--space-7);
  --card-gap: var(--space-7);

  /* Движение — см. раздел 7 ТЗ: одна кривая, две длительности, ничего
     дольше 300ms кроме перехода между главной и /catalog. */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --fast: 150ms;
  --base: 250ms;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 28px;
  --header-h: 72px;

  /* Нативные контролы (скроллбары, списки select, автозаполнение) — тёмные */
  color-scheme: dark;
}

@media (max-width: 767px) {
  :root {
    --fs-display: 44px;
    --fs-h2: 32px;
    --fs-h3: 22px;
    --fs-lead: 18px;
    --fs-body: 16px;
    --fs-small: 15px;
    --fs-label: 14px;
    --margin: 16px;
    --gutter: 16px;
    --section-pad: var(--space-8);
    --head-gap: var(--space-6);
    --card-gap: var(--space-6);
    --header-h: 56px;
  }
}

@media (min-width: 768px) and (max-width: 1279px) {
  :root {
    --margin: 32px;
    --gutter: 24px;
    --section-pad: var(--space-9);
    --head-gap: var(--space-7);
    --card-gap: var(--space-8);
  }
}

/* ── Сброс и база ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-main);
  font-size: var(--fs-body);
  line-height: 1.5;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p, figure, dl, dd, table { margin: 0; }
h1, h2, h3, p { overflow-wrap: break-word; }
table { border-collapse: collapse; width: 100%; }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: var(--ink);
  padding: var(--space-2) var(--space-4);
  font-weight: 500;
}
.skip-link:focus { left: var(--margin); top: var(--space-2); }

/* Типографика — 7 фиксированных ступеней, целые px */
h1, .fs-display { font-size: var(--fs-display); line-height: .95; font-weight: 500; letter-spacing: -0.02em; text-wrap: balance; }
h2, .fs-h2 { font-size: var(--fs-h2); line-height: 1; font-weight: 500; letter-spacing: -0.02em; text-wrap: balance; }
h3, .fs-h3 { font-size: var(--fs-h3); line-height: 1.15; font-weight: 500; }
.lede { font-size: var(--fs-lead); line-height: 1.4; font-weight: 400; color: var(--text-muted); max-width: 60ch; }
small, .fs-small { font-size: var(--fs-small); line-height: 1.4; }
.label, .eyebrow {
  font-size: var(--fs-label);
  line-height: 1.3;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}
p { max-width: 60ch; }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ── Раскладка ───────────────────────────────────────────────────────── */
.masthead, .hero, .section, .custom__inner, .cases, .site-footer, .contact-grid,
.mobile-menu nav, .legal { max-width: var(--content-max); margin-inline: auto; padding-inline: var(--margin); }

.section { padding-block: var(--section-pad); }
.section--flush-top { padding-top: 0; }
.section--flush-bottom { padding-bottom: 0; }

.section__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--space-5);
  margin-bottom: var(--head-gap);
  flex-wrap: wrap;
}
.section__note { color: var(--text-muted); font-size: var(--fs-small); }
.section__note--link { color: var(--accent); font-weight: 500; }
.section__note--link:hover { text-decoration: underline; text-decoration-color: currentColor; }

.rule-thin, .rule-thick { border: 0; border-top: 1px solid var(--line); }
.rule-thick { border-top-width: 1px; }

/* ── Шапка ───────────────────────────────────────────────────────────── */
.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: transparent;
  transition: background-color var(--base) var(--ease), border-color var(--base) var(--ease);
  border-bottom: 1px solid transparent;
}
.masthead[data-scrolled] {
  background: var(--bg);
  border-bottom-color: var(--line);
}
.masthead__row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
}
.logo { font-weight: 500; font-size: var(--fs-h3); letter-spacing: -0.01em; }
.logo b { font-weight: 500; color: var(--accent); }
.logo--footer { font-size: var(--fs-h3); }

.nav { display: flex; align-items: center; gap: var(--space-6); }
.nav a { font-size: var(--fs-label); font-weight: 500; color: var(--text-muted); transition: color var(--fast) var(--ease); }
.nav a:hover, .nav a[aria-current], .nav a.is-active { color: var(--text); }

.masthead__actions { display: flex; align-items: center; gap: var(--space-4); }
.btn--sm { height: 40px; padding-inline: var(--space-4); font-size: var(--fs-label); }

.cart-link { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--fs-label); font-weight: 500; color: var(--text-muted); transition: color var(--fast) var(--ease); }
.cart-link:hover { color: var(--text); }
.cart-link__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding-inline: 5px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
}
.cart-link__count[hidden] { display: none; }
.cart-link__icon { display: none; }
.mobile-menu nav .cart-link__count { position: relative; top: -2px; margin-left: var(--space-2); }
.icon-btn--mobile { display: none; width: 40px; height: 40px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: var(--radius); }

.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
}
.burger span { display: block; width: 20px; height: 1px; background: var(--text); margin-inline: auto; }

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-8);
}
.mobile-menu[hidden] { display: none; }
.mobile-menu nav { display: flex; flex-direction: column; gap: var(--space-5); padding-inline: var(--margin); }
.mobile-menu nav a { font-size: 28px; font-weight: 500; }
.mobile-menu .btn { margin-inline: var(--margin); align-self: flex-start; }

/* ── Кнопки ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding-inline: var(--space-6);
  border-radius: var(--radius);
  font-size: var(--fs-label);
  font-weight: 500;
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease), border-color var(--fast) var(--ease);
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn--solid { background: var(--accent); color: var(--ink); }
.btn--solid:hover { background: #ffd52e; }
.btn--ghost { border-color: var(--line); color: var(--text); }
.btn--ghost:hover { border-color: var(--text); }
.btn--dark { background: var(--ink); color: var(--paper); }
.btn--dark:hover { background: #000; }

.hero__actions { display: flex; gap: var(--space-4); flex-wrap: wrap; margin-top: var(--space-6); }

/* ── Первый экран ────────────────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: var(--space-8);
  min-height: 640px;
  max-height: 100svh;
  padding-block: var(--space-8);
}
.hero__eyebrow { color: var(--text-muted); font-size: var(--fs-small); margin-bottom: var(--space-3); }
.hero__title { margin-bottom: 0; }
.hero__title--xl { font-size: clamp(64px, 9vw, 140px); }
.hero__figure .frame {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-raised);
}
.hero__img { width: 100%; height: 100%; object-fit: cover; }

/* ── Питч под первым экраном ─────────────────────────────────────────── */
.pitch {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--margin);
  padding-block: var(--space-9);
  text-align: center;
}
.pitch__title { max-width: 20ch; margin-inline: auto; margin-bottom: var(--space-5); }
.pitch__text {
  color: var(--text-muted);
  max-width: 64ch;
  margin-inline: auto;
  margin-bottom: var(--space-5);
  font-size: var(--fs-h3);
  line-height: 1.3;
}
.pitch__list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  font-size: var(--fs-h3);
}
.pitch__list li { max-width: 64ch; }
.pitch__list li::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: var(--space-3);
  margin-bottom: 3px;
  border-radius: 50%;
  background: var(--accent);
}
.pitch__closing {
  font-size: var(--fs-h2);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
  max-width: 20ch;
  margin-inline: auto;
}

/* ── Плейсхолдер фото ────────────────────────────────────────────────── */
.ph {
  width: 100%;
  height: 100%;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  background: var(--bg-raised);
  color: var(--text-muted);
  border-radius: var(--radius);
}
.ph__mark { font-family: var(--font-mono); font-size: var(--fs-h3); }
.ph__text { font-size: var(--fs-label); }
.ph--wide { height: auto; aspect-ratio: 4 / 3; }

/* ── Каталог (главная и /catalog) ────────────────────────────────────── */
.grid--catalog {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--card-gap) var(--gutter);
}
@media (min-width: 768px) and (max-width: 1279px) {
  .grid--catalog { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .grid--catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.card { display: flex; flex-direction: column; }
.card__media { aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; background: var(--paper); margin-bottom: var(--space-4); }
.card__img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--base) var(--ease); }
.card:hover .card__img { transform: scale(1.02); }
.card__name { font-size: var(--fs-body); font-weight: 500; margin-bottom: var(--space-1); }
.card__desc { font-size: var(--fs-small); color: var(--text-muted); margin-bottom: var(--space-2); max-width: none; }
.price-row { display: flex; align-items: baseline; gap: var(--space-2); }
.price { font-family: var(--font-mono); font-weight: 500; }
.price--old { font-family: var(--font-mono); color: var(--text-muted); text-decoration: line-through; font-size: var(--fs-small); }

.tabs { display: flex; gap: var(--space-3); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none;
  height: 40px;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding-inline: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: var(--fs-label);
  font-weight: 500;
  color: var(--text-muted);
  transition: border-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.tab:hover { color: var(--text); }
.tab[aria-current] { color: var(--ink); background: var(--accent); border-color: var(--accent); }
.tab__count { font-family: var(--font-mono); font-size: var(--fs-small); opacity: .8; }

.empty { color: var(--text-muted); padding-block: var(--space-8); }

.catalog-teaser__more { display: flex; justify-content: center; margin-top: var(--card-gap); }

/* ── На заказ ────────────────────────────────────────────────────────── */
.custom { background: var(--accent); color: var(--ink); padding-block: var(--section-pad); }
.custom__inner { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: var(--space-8); }
.custom__title { margin-bottom: var(--space-4); }
.custom__text { color: rgba(20,20,20,.75); margin-bottom: var(--space-6); }
.steps { display: flex; flex-direction: column; gap: var(--space-5); }
.steps li { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--space-4); row-gap: var(--space-1); align-items: baseline; }
.steps__num { font-family: var(--font-mono); font-size: var(--fs-h3); grid-row: span 2; }
.steps__label { font-weight: 500; }
.steps__term { font-size: var(--fs-small); color: rgba(20,20,20,.65); }

.cases { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--card-gap) var(--gutter); margin-top: var(--space-8); }
.case .ph { height: auto; aspect-ratio: 4 / 3; margin-bottom: var(--space-3); background: rgba(20,20,20,.06); color: rgba(20,20,20,.5); }
.case__text { font-size: var(--fs-small); color: rgba(20,20,20,.8); margin-bottom: var(--space-1); max-width: none; }
.case__label { font-weight: 500; color: var(--ink); }

/* ── Производство ────────────────────────────────────────────────────── */
.production { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-8); }
.production__gallery { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gutter); align-content: start; }
.facts { display: flex; flex-direction: column; gap: var(--space-5); }
.facts__title { display: block; font-weight: 500; margin-bottom: var(--space-1); }
.facts__text { display: block; color: var(--text-muted); font-size: var(--fs-small); max-width: 46ch; }

/* ── Доставка ────────────────────────────────────────────────────────── */
.delivery-table th, .delivery-table td { text-align: left; padding: var(--space-4) var(--space-4) var(--space-4) 0; border-bottom: 1px solid var(--line); }
.delivery-table th { color: var(--text-muted); font-size: var(--fs-label); font-weight: 500; }
.delivery-table td:last-child, .delivery-table th:last-child { font-family: var(--font-mono); }

/* ── Заявка и контакты ───────────────────────────────────────────────── */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: var(--space-8); align-items: start; }
.contact-info { display: flex; flex-direction: column; gap: var(--space-5); }
.contact-info__text { color: var(--text-muted); font-size: var(--fs-small); }

.form { display: flex; flex-direction: column; gap: var(--space-5); max-width: 560px; margin-top: var(--space-6); }
.field { display: flex; flex-direction: column; gap: var(--space-2); }
.field[hidden] { display: none; }
.field label { font-size: var(--fs-label); font-weight: 500; color: var(--text-muted); }
.field input[type="text"], .field textarea, .field select, .field input[type="file"] {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-body);
  padding: var(--space-3) var(--space-4);
}
.field textarea { min-height: 120px; resize: vertical; }
.field input[type="file"] { padding: var(--space-3); }
.field--invalid input, .field--invalid textarea { border-color: #ff8f6b; }
.field__error { font-size: var(--fs-small); color: #ff8f6b; }
.field__hint { font-size: var(--fs-small); color: var(--text-muted); }

/* ── Корзина заявки на /order ────────────────────────────────────────── */
.cart { max-width: 560px; margin-top: var(--space-6); }
.cart[hidden] { display: none; }
.cart-item-list { display: flex; flex-direction: column; gap: var(--space-4); margin-top: var(--space-3); }
.cart-item { display: flex; gap: var(--space-4); }
.cart-item__media {
  flex: none;
  width: 72px;
  height: 90px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-raised);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cart-item__img { width: 100%; height: 100%; object-fit: cover; }
.cart-item__ph { font-family: var(--font-mono); color: var(--text-muted); font-size: var(--fs-small); }
.cart-item__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.cart-item__name { font-weight: 500; }
.cart-item__variant { font-size: var(--fs-small); color: var(--text-muted); }
.cart-item__row { display: flex; align-items: center; gap: var(--space-4); margin-top: var(--space-2); flex-wrap: wrap; }
.cart-item__row .qty { height: 36px; }
.cart-item__row .qty button { width: 32px; font-size: 16px; }
.cart-item__price { font-size: var(--fs-small); }
.cart-item__remove { color: var(--text-muted); font-size: 20px; line-height: 1; transition: color var(--fast) var(--ease); }
.cart-item__remove:hover { color: #ff8f6b; }
.cart-total { display: flex; justify-content: space-between; font-weight: 500; margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--line); }

.consent { display: flex; align-items: flex-start; gap: var(--space-3); font-size: var(--fs-small); color: var(--text-muted); }
.consent input { margin-top: 3px; }

.honey { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.notice { background: var(--bg-raised); border-left: 3px solid var(--accent); padding: var(--space-5); border-radius: var(--radius); margin-bottom: var(--space-5); }
.notice--error { border-left-color: #ff8f6b; }
.notice__id { display: block; margin-top: var(--space-2); color: var(--text-muted); font-family: var(--font-mono); font-size: var(--fs-small); }

.form__hint { font-size: var(--fs-small); color: var(--text-muted); }

/* ── Изделие ─────────────────────────────────────────────────────────── */
.bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); max-width: var(--content-max); margin-inline: auto; padding: var(--space-5) var(--margin); }
.bar__brand { font-weight: 500; font-size: var(--fs-h3); }
.bar__brand b { color: var(--accent); font-weight: 500; }
.bar__close { font-size: var(--fs-label); font-weight: 500; color: var(--text-muted); }
.bar__close:hover { color: var(--text); }
.bar .meta { font-family: var(--font-mono); font-size: var(--fs-small); color: var(--text-muted); }
.bar__rule { margin-bottom: var(--space-8); }

.product { max-width: var(--content-max); margin-inline: auto; padding-inline: var(--margin); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-8); padding-bottom: var(--space-9); }
.product__figure { border-radius: var(--radius); overflow: hidden; background: var(--paper); aspect-ratio: 4 / 5; }
.product__media { width: 100%; height: 100%; }
.product__img { width: 100%; height: 100%; object-fit: cover; }
.product__caption { padding: var(--space-3); font-size: var(--fs-small); color: var(--text-muted); }
.product__tag { margin-bottom: var(--space-3); }
.product__name { margin-bottom: var(--space-3); }
.product__desc { color: var(--text-muted); margin-bottom: var(--space-5); }
.product__price-row { display: flex; align-items: baseline; gap: var(--space-3); margin-bottom: var(--space-5); font-size: var(--fs-h3); }
.product__price { font-family: var(--font-mono); font-weight: 500; }
.product__old { font-family: var(--font-mono); color: var(--text-muted); text-decoration: line-through; }
.product__actions { display: flex; gap: var(--space-4); flex-wrap: wrap; margin-top: var(--space-6); }

/* ── Счётчик количества и «В корзину» ───────────────────────────────── */
.product__cart-row { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; margin-top: var(--space-6); }
.qty { display: inline-flex; align-items: center; height: 48px; border: 1px solid var(--line); border-radius: var(--radius); }
.qty button {
  width: 44px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-muted);
  transition: color var(--fast) var(--ease);
}
.qty button:hover { color: var(--text); }
.qty__value { min-width: 32px; text-align: center; font-family: var(--font-mono); font-size: var(--fs-body); }

.variants { margin-bottom: var(--space-6); font-size: var(--fs-small); }
.variants__caption { text-align: left; color: var(--text-muted); margin-bottom: var(--space-2); }
.variants th, .variants td { text-align: left; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--line); }
.variants th { color: var(--text-muted); font-weight: 500; }
.variants td { font-family: var(--font-mono); }
.variants tbody tr { cursor: pointer; transition: background-color var(--fast) var(--ease); }
.variants tbody tr:hover, .variants tbody tr.is-selected { background: var(--bg-raised); }
.variants__price--unknown { color: var(--text-muted); }

.specs { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-2); }
.specs > div { display: flex; justify-content: space-between; gap: var(--space-4); padding-block: var(--space-2); border-bottom: 1px solid var(--line); font-size: var(--fs-small); }
.specs dt { color: var(--text-muted); }
.specs dd { margin: 0; text-align: right; }

/* ── Быстрый просмотр (модальное окно) ──────────────────────────────── */
.qv {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
}
.qv[hidden] { display: none; }
.qv__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, .64);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: qv-backdrop-in var(--base) var(--ease);
}
.qv__panel {
  position: relative;
  width: min(960px, 100%);
  max-height: min(88vh, 920px);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 32px 64px rgba(0, 0, 0, .5);
  animation: qv-panel-in var(--base) var(--ease);
}
.qv__close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  z-index: 2;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 50%;
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.qv__close:hover { background: var(--accent); color: var(--ink); border-color: var(--accent); }
.qv__scroll {
  overflow-y: auto;
  padding: var(--space-8) var(--space-6) var(--space-6);
}
.qv__scroll .product { padding: 0; margin: 0; max-width: none; }
@media (max-width: 767px) {
  .qv { padding: 0; }
  .qv__panel { width: 100%; height: 100%; max-height: none; border-radius: 0; }
  .qv__scroll { padding: var(--space-8) var(--margin) var(--space-6); }
}
@media (prefers-reduced-motion: reduce) {
  .qv__backdrop, .qv__panel { animation: none; }
}
@keyframes qv-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes qv-panel-in {
  from { opacity: 0; transform: scale(.96) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Каталог: контакты в конце страницы ─────────────────────────────── */
.contacts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-8); padding-block: var(--space-9); align-items: start; }
.contacts__title { margin-bottom: 0; }
.contacts__text { color: var(--text-muted); margin-bottom: var(--space-5); }
.link-list { display: flex; flex-direction: column; gap: var(--space-3); }
.link-list a { display: flex; justify-content: space-between; gap: var(--space-4); padding-block: var(--space-3); border-bottom: 1px solid var(--line); font-weight: 500; transition: color var(--fast) var(--ease); }
.link-list a:hover { color: var(--accent); }
.link-list--footer { flex-direction: row; flex-wrap: wrap; gap: var(--space-6); }
.link-list--footer a { border-bottom: none; padding: 0; font-weight: 400; color: var(--text-muted); font-size: var(--fs-small); }
.link-list--footer a:hover { color: var(--text); }

/* ── Футер ───────────────────────────────────────────────────────────── */
.site-footer { padding-block: var(--space-8); display: flex; flex-direction: column; gap: var(--space-6); border-top: 1px solid var(--line); }
.site-footer__row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--space-4); }
.site-footer__nav { display: flex; flex-wrap: wrap; gap: var(--space-5); min-width: 0; }
.site-footer__nav a { font-size: var(--fs-small); color: var(--text-muted); }
.site-footer__nav a:hover { color: var(--text); }
.site-footer__legal { font-size: var(--fs-small); color: var(--text-muted); }

/* ── Ошибка и статичные страницы ─────────────────────────────────────── */
.error { max-width: var(--content-max); margin-inline: auto; padding-inline: var(--margin); padding-block: var(--space-10); }
.error__code { font-family: var(--font-mono); font-size: var(--fs-h2); color: var(--text-muted); margin-bottom: var(--space-4); }
.error__text { color: var(--text-muted); margin-block: var(--space-4) var(--space-6); }

.legal__body { max-width: 68ch; display: flex; flex-direction: column; gap: var(--space-3); margin-top: var(--space-8); }
.legal__body h2 { font-size: var(--fs-h3); margin-top: var(--space-6); }
.legal__body p { color: var(--text-muted); }
.legal__note { font-size: var(--fs-small); font-style: normal; color: var(--text-muted); margin-top: var(--space-6); }

/* ── Адаптив ─────────────────────────────────────────────────────────── */
@media (max-width: 1279px) {
  .nav { display: none; }
  .icon-btn--mobile { display: inline-flex; }
  .burger { display: flex; }
  .masthead__actions .btn--sm { display: none; }
}

@media (max-width: 767px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); min-height: 0; }
  .hero__figure { order: -1; }
  .custom__inner { grid-template-columns: minmax(0, 1fr); }
  .cases { grid-template-columns: minmax(0, 1fr); }
  .production { grid-template-columns: minmax(0, 1fr); }
  .production__gallery { grid-template-columns: minmax(0, 1fr); }
  .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .contacts { grid-template-columns: minmax(0, 1fr); }
  .product { grid-template-columns: minmax(0, 1fr); }
  .icon-btn--mobile { width: 36px; height: 36px; }
  .site-footer__nav { width: 100%; gap: var(--space-4); }
}

/* ── Сокращённое движение ────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

html { scroll-behavior: smooth; }
section[id] { scroll-margin-top: var(--header-h); }

/* View Transitions: карточка ↔ быстрый просмотр (kp-media) и переходы между
   страницами (@view-transition в блоке «iOS liquid glass» ниже). */
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-group(kp-media) { animation-duration: 250ms; animation-timing-function: var(--ease); }
}

/* ── Liquid glass + скругления ───────────────────────────────────────── */
:root {
  --glass-bg: linear-gradient(135deg, rgba(255,255,255,.10), rgba(255,255,255,.03));
  --glass-bg-strong: linear-gradient(135deg, rgba(255,255,255,.14), rgba(255,255,255,.05));
  --glass-border: rgba(255, 255, 255, .16);
  --glass-blur: blur(18px) saturate(180%);
  --glass-shadow:
    inset 0 1px 0 rgba(255,255,255,.28),
    inset 0 -1px 0 rgba(255,255,255,.04),
    0 8px 32px rgba(0,0,0,.35);
}

/* Фон, сквозь который «просвечивает» стекло. Раньше он висел на body с
   background-attachment: fixed — браузер перерисовывал весь экран на каждом
   кадре прокрутки. Теперь это отдельный закреплённый слой: рисуется один
   раз, при скролле только сдвигается на видеокарте. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60vw 50vh at 8% 4%, rgba(242,194,0,.16), transparent 60%),
    radial-gradient(50vw 50vh at 95% 35%, rgba(90,120,255,.14), transparent 60%),
    radial-gradient(55vw 50vh at 20% 95%, rgba(255,90,140,.10), transparent 60%);
  transform: translateZ(0);
}

.masthead[data-scrolled],
.mobile-menu,
.btn--ghost,
.tab,
.icon-btn--mobile,
.qty,
.notice,
.cart-item__media,
.qv__close,
.field input[type="text"], .field textarea, .field select, .field input[type="file"] {
  background: var(--glass-bg);
  border-color: var(--glass-border);
  box-shadow: var(--glass-shadow);
}
/* Настоящее размытие — только там, где под стеклом движется контент */
.mobile-menu {
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}

.masthead[data-scrolled] {
  background: var(--glass-bg-strong);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  border-bottom-color: var(--glass-border);
}
.mobile-menu { background: rgba(18,18,18,.72); border-radius: 0; box-shadow: none; }

.qv__panel {
  background: var(--glass-bg-strong), rgba(20,20,20,.55);
  border-color: var(--glass-border);
  border-radius: var(--radius-lg);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
  box-shadow: var(--glass-shadow), 0 32px 64px rgba(0,0,0,.5);
}
.qv__backdrop { background: rgba(10,10,10,.5); }
@media (max-width: 767px) { .qv__panel { border-radius: 0; } }

.btn--ghost:hover, .tab:hover { background: var(--glass-bg-strong); border-color: rgba(255,255,255,.3); }
.btn--solid, .tab[aria-current] {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 -2px 6px rgba(0,0,0,.12), 0 6px 20px rgba(242,194,0,.25);
}
.btn--dark { box-shadow: inset 0 1px 0 rgba(255,255,255,.18); }

.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Скругления */
.btn, .tab, .qty, .cart-link__count { border-radius: 999px; }
.qv__close { border-radius: 50%; }
.field input[type="text"], .field textarea, .field select, .field input[type="file"] { border-radius: var(--radius-sm); }
.hero__figure .frame, .card__media, .product__figure, .ph { border-radius: var(--radius-lg); }
.cart-item__media { border-radius: var(--radius-sm); }
.notice { border-radius: var(--radius); }
.variants tbody tr:hover, .variants tbody tr.is-selected { background: var(--glass-bg); }
.custom { border-radius: var(--radius-lg); margin-inline: var(--space-4); }
.skip-link { border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
@media (max-width: 767px) { .custom { margin-inline: var(--space-2); border-radius: var(--radius); } }

/* ══ iOS liquid glass: пружина, кромка, плавные переходы ═════════════════ */
:root {
  /* Мягкая пружина: перелёт ~2% вместо прежних 16% — движение «доезжает»
     без подпрыгивания */
  --spring: cubic-bezier(.25, 1.05, .4, 1);
  --ease-out: cubic-bezier(.22, 1, .36, 1);

  --glass-bg: linear-gradient(135deg, rgba(255,255,255,.05), rgba(255,255,255,.01));
  --glass-bg-strong: linear-gradient(135deg, rgba(255,255,255,.10), rgba(255,255,255,.03));
  --glass-border: rgba(255, 255, 255, .07);
  --glass-blur: blur(22px) saturate(190%);
  /* Объём только через inset: блик сверху-слева, слабый снизу-справа, свечение снизу */
  --glass-shadow:
    inset 1px 1px 1px -.5px rgba(255,255,255,.25),
    inset -1px -1px 1px -.5px rgba(255,255,255,.08),
    inset 0 -8px 16px -12px rgba(255,255,255,.10);
}
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --spring: linear(0, .043 3.8%, .145 7.7%, .275 11.5%, .412 15.4%, .542 19.2%, .657 23.1%, .754 26.9%, .833 30.8%, .894 34.6%, .94 38.5%, .972 42.3%, .994 46.2%, 1.008 50%, 1.016 53.8%, 1.02 61.5%, 1.016 69.2%, 1.011 76.9%, 1.006 84.6%, 1.002 92.3%, 1);
  }
}

/* Стекло без внешних теней: у элементов с backdrop-filter только inset */
.mobile-menu, .qv__panel { box-shadow: var(--glass-shadow); }

/* Жёлтые кнопки: янтарный градиент и inset-блики */
.btn--solid, .tab[aria-current] {
  background: linear-gradient(180deg, #ffd84a 0%, #f2c200 55%, #e0a800 100%);
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,.65),
    inset 0 -2px 4px rgba(150,90,0,.3);
}
.btn--solid:hover { background: linear-gradient(180deg, #ffe066 0%, #ffcf1f 55%, #eab308 100%); }

/* ── Шапка: плавающая стеклянная «таблетка» ──────────────────────────── */
.masthead,
.masthead[data-scrolled] {
  background: none;
  border-bottom-color: transparent;
  border-radius: 0;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* Размытие за шапкой: на всю ширину окна, нижний край плавно растворяется */
.masthead::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: calc(var(--header-h) + 16px);
  z-index: -1;
  background: linear-gradient(to bottom, rgba(18,18,18,.78), rgba(18,18,18,.45));
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent);
  mask-image: linear-gradient(to bottom, #000 62%, transparent);
  opacity: 0;
  transition: opacity .35s var(--ease-out);
  pointer-events: none;
}
.masthead[data-scrolled]::before { opacity: 1; }

/* ── Скользящий индикатор меню ───────────────────────────────────────── */
.masthead .nav { position: relative; gap: var(--space-2); }
.nav a {
  position: relative;
  z-index: 1;
  padding: 8px 16px;
  border-radius: 999px;
  background: none;
  box-shadow: none;
}
.nav__indicator {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 0;
  width: 0;
  height: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255,255,255,.10), rgba(255,255,255,.03));
  box-shadow:
    inset 1px 1px 1px -.5px rgba(255,255,255,.3),
    inset -1px -1px 1px -.5px rgba(255,255,255,.1);
  opacity: 0;
  pointer-events: none;
  will-change: transform, width, height;
  view-transition-name: kp-nav-ind;
}
.nav__indicator.is-ready {
  transition: transform 650ms var(--spring), width 650ms var(--spring), height 650ms var(--spring), opacity .3s var(--ease-out);
}
.nav__indicator.is-visible { opacity: 1; }

/* ── Стеклянные плашки: футер, карточки, фото ────────────────────────── */
.site-footer {
  margin-block: var(--space-6) var(--space-4);
  max-width: calc(var(--content-max) - var(--margin));
  width: calc(100% - var(--margin));
  padding: var(--space-8) var(--margin);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  box-shadow: var(--glass-shadow);
}
.card__media, .hero__figure .frame, .product__figure, .ph, .cart-item__media {
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}
.card { transition: transform .5s var(--ease-out); }
.card:hover { transform: translateY(-4px); }
.card__media { transition: box-shadow .5s var(--ease-out), border-color .5s var(--ease-out); }
.card:hover .card__media { border-color: rgba(255,255,255,.14); box-shadow: var(--glass-shadow), 0 18px 40px -18px rgba(0,0,0,.7); }
.card__img { transition: transform .9s var(--ease-out); }
.card:hover .card__img { transform: scale(1.035); }
.card__name { transition: color .25s var(--ease-out); }
.card:hover .card__name { color: #fff; }

/* Нажатие: быстро «вдавливается», мягко отпружинивает */
.btn, .tab, .icon-btn--mobile, .burger, .qv__close {
  transition: transform .4s var(--spring), background-color .2s var(--ease-out), color .2s var(--ease-out), border-color .2s var(--ease-out), box-shadow .2s var(--ease-out);
}
.btn:active, .tab:active, .icon-btn--mobile:active, .burger:active, .qv__close:active { transform: scale(.96); transition-duration: .1s; }

/* Мобильное меню и быстрый просмотр */
@keyframes kp-menu-in { from { opacity: 0; transform: scale(1.02); } to { opacity: 1; transform: none; } }
@keyframes kp-menu-out { to { opacity: 0; transform: scale(1.02); } }
@keyframes kp-item-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes kp-panel-spring { from { opacity: 0; transform: scale(.96) translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes kp-panel-out { to { opacity: 0; transform: scale(.97) translateY(10px); } }
@keyframes kp-fade-out { to { opacity: 0; } }
@media (prefers-reduced-motion: no-preference) {
  .mobile-menu { animation: kp-menu-in .4s var(--ease-out); }
  .mobile-menu.is-closing { animation: kp-menu-out .22s var(--ease-out) forwards; }
  .mobile-menu nav a, .mobile-menu .btn { animation: kp-item-in .6s var(--ease-out) backwards; }
  .mobile-menu.is-closing nav a, .mobile-menu.is-closing .btn { animation: none; }
  .mobile-menu nav a:nth-child(1) { animation-delay: .05s; }
  .mobile-menu nav a:nth-child(2) { animation-delay: .10s; }
  .mobile-menu nav a:nth-child(3) { animation-delay: .15s; }
  .mobile-menu nav a:nth-child(4) { animation-delay: .20s; }
  .mobile-menu nav a:nth-child(5) { animation-delay: .25s; }
  .mobile-menu nav a:nth-child(n+6) { animation-delay: .30s; }
  .mobile-menu .btn { animation-delay: .35s; }
  .qv__panel { animation: kp-panel-spring .5s var(--spring); }
  .qv.is-closing .qv__panel { animation: kp-panel-out .22s var(--ease-out) forwards; }
  .qv.is-closing .qv__backdrop { animation: kp-fade-out .22s var(--ease-out) forwards; }
}

/* ── Появление блоков при скролле (чистый CSS) ───────────────────────── */
/* Только opacity и transform — их браузер анимирует на видеокарте. Раньше
   здесь был ещё filter: blur(), который пересчитывался для каждой карточки
   на каждом кадре прокрутки. */
@keyframes kp-reveal {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .section__head, .card, .steps li, .facts > *, .case, .pitch > *, .contact-info > *, .link-list a {
      animation: kp-reveal linear backwards;
      animation-timeline: view();
      animation-range: entry 0% entry 45%;
    }
  }
}

/* ── Переходы между страницами ───────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }

  /* Короткий кроссфейд без размытия: снимок всей страницы с blur() дорого
     считать, и переход ощущался как задержка загрузки. */
  @keyframes kp-page-out { to { opacity: 0; } }
  @keyframes kp-page-in { from { opacity: 0; transform: translateY(8px); } }
  ::view-transition-old(root) { animation: kp-page-out 160ms var(--ease-out) both; }
  ::view-transition-new(root) { animation: kp-page-in 320ms var(--ease-out) both; }
  ::view-transition-group(kp-nav-ind) { animation-duration: 500ms; animation-timing-function: var(--spring); }
}

/* Слайдер фотографий изделия */
.gallery { position: relative; width: 100%; height: 100%; }
.gallery__track { display: flex; width: 100%; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__track:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.gallery__slide { flex: 0 0 100%; scroll-snap-align: start; scroll-snap-stop: always; }
.gallery__btn { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,.28); background: rgba(20,20,20,.45); color: #fff; font-size: 26px; line-height: 1; display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(10px) saturate(1.4); -webkit-backdrop-filter: blur(10px) saturate(1.4); transition: opacity var(--base) var(--ease), background var(--base) var(--ease); }
.gallery__btn:hover { background: rgba(20,20,20,.65); }
.gallery__btn:disabled { opacity: 0; pointer-events: none; }
.gallery__btn--prev { left: var(--space-3); padding-bottom: 3px; }
.gallery__btn--next { right: var(--space-3); padding-bottom: 3px; }
.gallery__dots { position: absolute; left: 50%; bottom: var(--space-3); transform: translateX(-50%); display: flex; gap: 6px; padding: 6px 10px; border-radius: 999px; background: rgba(20,20,20,.4); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.gallery__dot { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 999px; background: rgba(255,255,255,.45); cursor: pointer; transition: width .35s var(--ease-out), background-color .35s var(--ease-out); }
.gallery__dot.is-active { width: 18px; background: #fff; }
@media (hover: none) { .gallery__btn { display: none; } }

/* ── Мобильная шапка: корзина всегда на виду ─────────────────────────── */
@media (max-width: 1279px) {
  .masthead__actions { gap: var(--space-3); }
  .masthead .cart-link {
    position: relative;
    width: 40px;
    height: 40px;
    justify-content: center;
    color: var(--text);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    background: var(--glass-bg);
    box-shadow: var(--glass-shadow);
  }
  .masthead .cart-link__icon { display: block; }
  .masthead .cart-link__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .masthead .cart-link__count { position: absolute; top: -6px; right: -6px; }
}
@media (max-width: 767px) {
  .masthead .cart-link { width: 36px; height: 36px; }
  /* Первый экран на телефоне растёт по контенту: иначе фиксированная
     высота обрезает блок, и «питч» налезает на кнопки героя. */
  .hero { max-height: none; padding-block: var(--space-5) var(--space-7); }
  .pitch { padding-block: var(--space-8); }
}

/* ══ Выпадающий список «Изделие» ═════════════════════════════════════════
   Без JS — нативный select, но в стиле сайта: своя стрелка, тёмный список
   (color-scheme: dark). С JS поверх него собирается свой список: фото,
   артикул, название и цена в строке, группы по разделам каталога, поиск
   и управление с клавиатуры. Нативный select остаётся в форме и
   отправляется как раньше. */
.field select.select {
  -webkit-appearance: none;
  appearance: none;
  min-height: 52px;
  padding-right: 48px;
  cursor: pointer;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%239a9892' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 18px center / 12px 8px,
    var(--glass-bg);
  transition: border-color .2s var(--ease-out);
}
.field select.select:hover { border-color: rgba(255,255,255,.18); }
.field select.select option,
.field select.select optgroup { background: #1c1c1c; color: var(--text); }
.field select.select optgroup { color: var(--text-muted); font-weight: 500; }

.kp-select { position: relative; }
.kp-select__native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0;
  pointer-events: none;
  clip-path: inset(50%);
}

.kp-select__trigger {
  width: 100%;
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 9px 16px 9px 9px;
  text-align: left;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: var(--glass-bg);
  box-shadow: var(--glass-shadow);
  transition: border-color .2s var(--ease-out), background-color .2s var(--ease-out);
}
.kp-select__trigger:hover { border-color: rgba(255,255,255,.18); }
.kp-select__trigger:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.kp-select.is-open .kp-select__trigger { border-color: rgba(242,194,0,.55); }
.kp-select__trigger .kp-select__text { flex: 1; }
.kp-select__trigger .kp-select__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kp-select__trigger.is-empty .kp-select__name { color: var(--text-muted); font-weight: 400; }

.kp-select__chevron {
  flex: none;
  width: 12px;
  height: 8px;
  color: var(--text-muted);
  transition: transform .35s var(--spring), color .2s var(--ease-out);
}
.kp-select.is-open .kp-select__chevron { transform: rotate(180deg); color: var(--accent); }

/* Общие части строки: превью, артикул, название, цена */
.kp-select__thumb {
  flex: none;
  width: 34px;
  height: 42px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--paper);
  display: grid;
  place-items: center;
}
.kp-select__thumb img { width: 100%; height: 100%; object-fit: cover; }
.kp-select__thumb--ph { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); color: var(--text-muted); font-family: var(--font-mono); font-size: 11px; }
.kp-select__thumb--custom { background: rgba(242,194,0,.08); border: 1px dashed rgba(242,194,0,.45); color: var(--accent); }
.kp-select__thumb--custom svg { width: 14px; height: 14px; }
.kp-select__text { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.kp-select__art { font-family: var(--font-mono); font-size: 12px; line-height: 1.3; color: var(--text-muted); letter-spacing: .02em; }
.kp-select__name { font-size: var(--fs-small); line-height: 1.3; font-weight: 500; color: var(--text); }
.kp-select__price { flex: none; font-family: var(--font-mono); font-size: 14px; font-weight: 500; color: var(--text); white-space: nowrap; }

/* Панель */
.kp-select__panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  padding: 6px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius);
  /* Непрозрачный фон: форма под списком не просвечивает, а без
     backdrop-filter панель открывается мгновенно и на слабых телефонах */
  background: linear-gradient(180deg, #1f1f1f, #181818);
  box-shadow: var(--glass-shadow), 0 24px 60px -16px rgba(0,0,0,.8);
  transform-origin: 50% 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(.98);
  pointer-events: none;
  transition: opacity .18s var(--ease-out), transform .18s var(--ease-out), visibility 0s linear .18s;
}
.kp-select--up .kp-select__panel { top: auto; bottom: calc(100% + 8px); transform-origin: 50% 100%; transform: translateY(6px) scale(.98); }
.kp-select.is-open .kp-select__panel {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
  transition: opacity .2s var(--ease-out), transform .32s var(--spring), visibility 0s;
}

.kp-select__search {
  position: relative;
  flex: none;
  margin-bottom: 6px;
}
.kp-select__search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
/* .kp-select в селекторе — чтобы перебить общие стили полей формы
   (.field input[type="text"] и жёлтую обводку .field input:focus) */
.kp-select .kp-select__search input {
  width: 100%;
  height: 42px;
  padding: 0 12px 0 38px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.04);
  box-shadow: none;
  color: var(--text);
  font: inherit;
  font-size: var(--fs-small);
  outline: none;
  transition: border-color .2s var(--ease-out), background-color .2s var(--ease-out);
}
.kp-select .kp-select__search input::placeholder { color: var(--text-muted); }
.kp-select .kp-select__search input:focus { outline: none; border-color: rgba(242,194,0,.45); background: rgba(255,255,255,.06); }

.kp-select__list {
  max-height: min(380px, 52vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.18) transparent;
  border-radius: var(--radius-sm);
}
.kp-select__list::-webkit-scrollbar { width: 8px; }
.kp-select__list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }

.kp-select__group {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 10px 6px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: linear-gradient(to bottom, #1d1d1d 75%, rgba(29,29,29,0));
}

.kp-select__option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 7px 10px 7px 7px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color .15s var(--ease-out);
}
.kp-select__option + .kp-select__option { margin-top: 2px; }
.kp-select__option .kp-select__text { flex: 1; }
.kp-select__option.is-active { background: rgba(255,255,255,.07); }
.kp-select__option[aria-selected="true"] { background: rgba(242,194,0,.1); }
.kp-select__option[aria-selected="true"].is-active { background: rgba(242,194,0,.15); }
.kp-select__option[aria-selected="true"] .kp-select__name { color: var(--accent); }
.kp-select__check {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--accent);
  opacity: 0;
  transform: scale(.6);
  transition: opacity .2s var(--ease-out), transform .3s var(--spring);
}
.kp-select__option[aria-selected="true"] .kp-select__check { opacity: 1; transform: none; }
.kp-select__option[hidden], .kp-select__group[hidden] { display: none; }

.kp-select__empty { padding: var(--space-5) var(--space-3); text-align: center; font-size: var(--fs-small); color: var(--text-muted); max-width: none; }
.kp-select__empty[hidden] { display: none; }

@media (max-width: 767px) {
  .kp-select__price { font-size: 13px; }
  .kp-select__list { max-height: 50vh; }
}
@media (hover: none) {
  .kp-select .kp-select__search input { font-size: 16px; } /* iOS не зумит поле при фокусе */
}
/* Подсказку под полем прячем, пока открыт список: иначе её первая буква
   выглядывает из-за скруглённого угла панели */
.kp-select ~ .field__hint { transition: opacity .2s var(--ease-out); }
.kp-select.is-open ~ .field__hint { opacity: 0; }
