/* ==========================================================================
   AMID WEAR — спецодежда. Общие стили.
   ========================================================================== */

:root {
  --ink: #0c0d0f;
  --ink-2: #14161a;
  --ink-3: #1d2025;
  --line: #2a2e35;
  --paper: #f5f4f1;
  --paper-2: #eceae5;
  --fg: #f2f1ee;
  --fg-dim: #9aa0a8;
  --fg-mute: #6d737b;
  --accent: #f2701c;
  --accent-2: #ff8a3d;
  --lime: #c6e14b;
  --ok: #3fae6a;
  --bad: #e5484d;

  --max: 1320px;
  --gut: clamp(18px, 4vw, 56px);
  --r: 4px;

  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-2: cubic-bezier(.65, 0, .35, 1);

  --h1: clamp(2.6rem, 7.4vw, 7.4rem);
  --h2: clamp(2rem, 4.8vw, 4.2rem);
  --h3: clamp(1.3rem, 2.2vw, 2rem);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  background: var(--ink);
  color: var(--fg);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'ss01', 'cv05';
}

body.is-locked { overflow: hidden; }

img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: #fff; }

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

/* ---------- типографика ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: .7rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before {
  content: ''; width: 26px; height: 2px; background: var(--accent); flex: none;
}
h1, h2, h3, h4 { font-weight: 800; line-height: 1.03; letter-spacing: -.028em; }
h1 { font-size: var(--h1); font-weight: 900; }
h2 { font-size: var(--h2); }
h3 { font-size: var(--h3); }
.lead { font-size: clamp(1rem, 1.5vw, 1.2rem); color: var(--fg-dim); max-width: 56ch; }

/* ---------- кнопки ---------- */
.btn {
  --bg: var(--accent); --c: #fff;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px 30px; border-radius: 100px; background: var(--bg); color: var(--c);
  font-weight: 700; font-size: .92rem; letter-spacing: .01em;
  overflow: hidden; isolation: isolate; will-change: transform;
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
}
.btn::after {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: var(--accent-2); transform: translateY(101%); transition: transform .5s var(--ease);
}
.btn:hover::after { transform: translateY(0); }
.btn:hover { box-shadow: 0 14px 34px -12px rgba(242, 112, 28, .7); }
.btn:active { transform: scale(.97); }
.btn--ghost { --bg: transparent; --c: var(--fg); box-shadow: inset 0 0 0 1px var(--line); }
.btn--ghost::after { background: var(--fg); }
.btn--ghost:hover { --c: var(--ink); box-shadow: inset 0 0 0 1px var(--fg); }
.btn--light { --bg: var(--fg); --c: var(--ink); }
.btn--light::after { background: var(--accent); }
.btn--light:hover { --c: #fff; }
.btn--sm { padding: 11px 20px; font-size: .84rem; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .6; cursor: progress; }

/* ---------- шапка ---------- */
.hdr {
  position: fixed; inset: 0 0 auto; z-index: 90;
  display: flex; align-items: center;
  height: 74px;
  transition: background .45s var(--ease), backdrop-filter .45s var(--ease), border-color .45s,
              transform .45s var(--ease);
  border-bottom: 1px solid transparent;
}
.hdr.is-stuck,
.hdr--solid {
  background: rgba(12, 13, 15, .86);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: var(--line);
}
/* внутренние страницы светлые — шапке нужен фон с самого верха */
.hdr--solid { background: var(--ink); }
.hdr.is-hidden { transform: translateY(-100%); }
.hdr__in { display: flex; align-items: center; gap: 28px; width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gut); }
.logo { display: flex; align-items: center; gap: 11px; }
.logo__mark { width: 44px; height: auto; flex: none; }
.logo__txt { display: grid; gap: 3px; line-height: 1; }
.logo__txt b {
  font-size: 1.06rem; font-weight: 700; letter-spacing: .26em; color: var(--fg);
}
.logo__txt i {
  display: flex; align-items: center; gap: 6px;
  font-style: normal; font-size: .58rem; font-weight: 600; letter-spacing: .42em; color: var(--fg-dim);
}
.logo__txt i::before, .logo__txt i::after {
  content: ''; flex: 1; height: 1px; background: currentColor; opacity: .55;
}
.ftr .logo__mark { width: 56px; }

.nav { display: flex; gap: 26px; margin-left: auto; }
.nav a {
  position: relative; font-size: .9rem; font-weight: 500; color: var(--fg-dim);
  transition: color .3s;
}
.nav a::after {
  content: ''; position: absolute; left: 0; bottom: -6px; height: 1.5px; width: 100%;
  background: var(--accent); transform: scaleX(0); transform-origin: right;
  transition: transform .45s var(--ease);
}
.nav a:hover, .nav a[aria-current] { color: var(--fg); }
.nav a:hover::after, .nav a[aria-current]::after { transform: scaleX(1); transform-origin: left; }

.hdr__act { display: flex; align-items: center; gap: 12px; }

/* переключатель валют */
.cur {
  display: flex; gap: 2px; padding: 3px; border-radius: 100px;
  background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px var(--line);
}
.cur button {
  padding: 7px 12px; border-radius: 100px; font-size: .76rem; font-weight: 700;
  color: var(--fg-mute); transition: color .3s, background .3s;
}
.cur button[aria-pressed='true'] { background: var(--accent); color: #fff; }
.cur button:hover { color: var(--fg); }

.burger { display: none; width: 42px; height: 42px; align-items: center; justify-content: center; }
.burger i { display: block; width: 20px; height: 1.5px; background: var(--fg); position: relative; transition: background .3s; }
.burger i::before, .burger i::after {
  content: ''; position: absolute; left: 0; width: 100%; height: 100%; background: var(--fg);
  transition: transform .45s var(--ease);
}
.burger i::before { top: -6px; } .burger i::after { top: 6px; }
.burger.is-on i { background: transparent; }
.burger.is-on i::before { transform: translateY(6px) rotate(45deg); }
.burger.is-on i::after { transform: translateY(-6px) rotate(-45deg); }

/* мобильное меню */
.mnav {
  position: fixed; inset: 0; z-index: 89; display: grid; align-content: center; gap: 6px;
  padding: 90px var(--gut) 40px; background: var(--ink-2);
  clip-path: inset(0 0 100% 0); transition: clip-path .7s var(--ease);
}
.mnav.is-open { clip-path: inset(0 0 0 0); }
.mnav a { font-size: clamp(2rem, 9vw, 3.4rem); font-weight: 800; letter-spacing: -.03em; }
.mnav a small { display: block; font-size: .8rem; font-weight: 500; color: var(--fg-mute); letter-spacing: 0; }

/* ---------- анимации появления ----------
   Прячем элементы до появления, только пока на <html> есть класс .js — его ставит
   строчка в <head> и снимает, если анимации так и не запустились. Иначе при сбое
   скриптов (старый кэш, урезанный встроенный браузер) блоки — и кнопка брендирования
   среди них — оставались бы прозрачными навсегда. */
.js [data-rise] {
  opacity: 0; transform: translateY(34px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
  transition-delay: var(--d, 0ms);
}
.js [data-rise].is-in { opacity: 1; transform: none; }

[data-mask] { overflow: hidden; display: block; }
[data-mask] > * { display: block; }
.js [data-mask] > * {
  transform: translateY(105%);
  transition: transform 1.05s var(--ease); transition-delay: var(--d, 0ms);
}
.js [data-mask].is-in > * { transform: none; }

.js [data-scale] {
  clip-path: inset(12% 12% 12% 12% round 6px);
  transition: clip-path 1.2s var(--ease); transition-delay: var(--d, 0ms);
}
.js [data-scale].is-in { clip-path: inset(0 0 0 0 round 6px); }

/* ---------- футер ---------- */
.ftr { background: var(--ink-2); border-top: 1px solid var(--line); padding: 70px 0 32px; }
.ftr__grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 40px; }
.ftr h4 { font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; color: var(--fg-mute); margin-bottom: 18px; font-weight: 700; }
.ftr ul { list-style: none; display: grid; gap: 10px; }
.ftr li a, .ftr li { font-size: .92rem; color: var(--fg-dim); transition: color .3s; }
.ftr li a:hover { color: var(--accent); }
.ftr__note { font-size: .9rem; color: var(--fg-mute); max-width: 34ch; margin-top: 16px; }
.ftr__bot {
  display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between;
  margin-top: 54px; padding-top: 24px; border-top: 1px solid var(--line);
  font-size: .82rem; color: var(--fg-mute);
}
.ftr__bot a { color: var(--fg-dim); transition: color .3s; }
.ftr__bot a:hover { color: var(--accent); }

/* ---------- утилиты ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 100px;
  font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  background: rgba(255, 255, 255, .07); color: var(--fg-dim);
}
.chip--accent { background: rgba(242, 112, 28, .16); color: var(--accent-2); }

/* ---------- цены скрыты (SHOP.showPrices = false) ---------- */
/* на месте сумм стоит текст «Цена по запросу» — ему нужен кегль поменьше */
.no-prices .card__price b { font-size: .96rem; letter-spacing: -.01em; }
.no-prices .show__price { font-size: clamp(1rem, 1.5vw, 1.2rem); font-weight: 800; }
.no-prices .pd__price b { font-size: clamp(1.3rem, 2.4vw, 1.7rem); }
.no-prices .pd__sum b { font-size: 1.1rem; }
.no-prices .calc__total b { font-size: clamp(1.1rem, 2vw, 1.4rem); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* ловушка для спам-ботов в формах заявки: человек поле не видит, бот его заполняет */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- модальное окно ----------
   Открывается двумя путями: скрипт ставит класс .is-open, а если скрипт окна
   не запустился (на <html> нет класса brand-js) — сам якорь #brand-form через :target.
   Стороны заданы явно, а не через inset: его нет в Safari до iOS 14.5, и окно
   в браузере Instagram на старых iPhone открывалось за пределами экрана. */
.modal {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 95;
  display: none; align-items: center; justify-content: center; padding: var(--gut);
}
.modal.is-open,
html:not(.brand-js) .modal:target { display: flex; }
/* без backdrop-filter: размытие всей страницы под окном пересчитывается каждый кадр
   и заметно тормозит на ноутбуках со встроенной графикой. Плотной заливки достаточно */
.modal__back {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: block;
  background: rgba(6, 7, 9, .9); cursor: default;
  animation: modalBack .35s var(--ease);
}
@keyframes modalBack { from { opacity: 0; } }
.modal__box {
  position: relative; width: min(620px, 100%); max-height: min(88vh, 860px); overflow-y: auto;
  contain: layout paint;        /* браузер не пересчитывает страницу под окном */
  padding: clamp(26px, 4vw, 38px); border-radius: var(--r);
  background: var(--ink-2); box-shadow: 0 50px 90px -40px rgba(0, 0, 0, .9), inset 0 0 0 1px var(--line);
  animation: modalBox .5s var(--ease);
  scrollbar-width: thin; scrollbar-color: #3a3f47 transparent;
}
@keyframes modalBox { from { opacity: 0; transform: translateY(26px) scale(.97); } }
.modal__box::-webkit-scrollbar { width: 6px; }
.modal__box::-webkit-scrollbar-thumb { background: #3a3f47; border-radius: 10px; }
.modal__box h3 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin: 10px 0 8px; }
.modal__sub { color: var(--fg-dim); font-size: .94rem; max-width: 46ch; }
.modal__x {
  position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; color: var(--fg-dim);
  box-shadow: inset 0 0 0 1px var(--line); transition: color .3s, box-shadow .3s, transform .4s var(--ease);
}
.modal__x:hover { color: var(--fg); box-shadow: inset 0 0 0 1px var(--fg-mute); transform: rotate(90deg); }

/* итог обычной отправки формы без скриптов — api/lead.php возвращает на #brand-sent / #brand-error */
.pop {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 96;
  display: none; align-items: center; justify-content: center; padding: var(--gut);
  background: rgba(6, 7, 9, .9);
}
.pop:target { display: flex; }
.pop__box {
  display: grid; gap: 12px; justify-items: start; width: min(440px, 100%);
  padding: 28px; border-radius: var(--r); background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line);
}
.pop__box b { font-size: 1.25rem; }
.pop__box p { color: var(--fg-dim); font-size: .94rem; }
.pop__box p a { color: var(--accent-2); }

@media (max-width: 960px) {
  .nav { display: none; }
  .burger { display: flex; }
  .ftr__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  /* в узкой шапке остаются логотип, валюта и бургер — кнопка живёт в меню */
  .hdr { height: 62px; }
  .hdr__in { gap: 12px; }
  .hdr__act .btn { display: none; }
}
@media (max-width: 560px) {
  .ftr__grid { grid-template-columns: 1fr; gap: 30px; }
  .cur button { padding: 7px 9px; font-size: .72rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  [data-rise], [data-mask] > *, [data-scale] { opacity: 1 !important; transform: none !important; clip-path: none !important; }
}
