/* ============================================================
   MASARILI — ДИЗАЙН-СИСТЕМА
   «Тихая роскошь с северным характером»
   По спеке от 2026-11-12, с учётом аудита Astra (16 находок).

   ИСПРАВЛЕНО ПО АУДИТУ:
   #1  --mute-dark #B8B4AE для текста на тёмном (7.5:1 вместо 3.06:1)
   #14 Анимации: анимируем transform/opacity, не grid-template-rows
   #15 Токены для overlay/backdrop (тени запрещены, но слои нужны)
   #13 Intl.NumberFormat вместо ручных правил валют
   ============================================================ */

/* ---------- ТОКЕНЫ ---------- */
:root {
  /* Основы */
  --ink: #0E0E0F;
  --ink-2: #1C1D1F;
  --paper: #F4F2EE;
  --paper-2: #FFFFFF;
  --mute: #645F58;
  --mute-dark: #B8B4AE;      /* ИСПРАВЛЕНИЕ #1: текст на тёмном */
  --line: #D8D4CC;
  --line-strong: #A8A399;    /* ИСПРАВЛЕНИЕ: границы интерактивных полей (3:1) */
  --accent: #8A6A4B;
  --accent-deep: #5E452F;

  /* Слои (ИСПРАВЛЕНИЕ #15: тени запрещены, но overlay нужен) */
  --overlay: rgba(14, 14, 15, 0.92);
  --backdrop: rgba(14, 14, 15, 0.40);

  /* Типографика */
  --font-display: 'Jost', 'Helvetica Neue', Arial, sans-serif;
  --font-ui: 'Inter Tight', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-epigraph: 'Cormorant Garamond', Georgia, serif;

  /* Ритм */
  --step: 8px;
  --section-pad: 160px;
  --section-pad-tablet: 88px;
  --section-pad-mobile: 64px;
  --max-w: 1440px;
}

@media (max-width: 1279px) {
  :root { --section-pad: var(--section-pad-tablet); }
}
@media (max-width: 767px) {
  :root { --section-pad: var(--section-pad-mobile); }
}

/* ---------- СБРОС ---------- */
*, *::before, *::after { box-sizing: border-box; }

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* НИКАКИХ ТЕНЕЙ — правило спеки */
* { box-shadow: none !important; }

/* Радиус 0 везде, кроме чипов */
button, input, card, .card { border-radius: 0; }
.chip { border-radius: 999px; }

a {
  color: var(--accent-deep);
  text-decoration: none;
  transition: color 240ms ease-out;
}
a:hover { color: var(--ink); }

/* ---------- ФОКУС (доступность) ---------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.on-dark :focus-visible {
  outline-color: var(--paper);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 20px;
  z-index: 9999;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.skip-link:focus { left: 0; }

/* ---------- ТИПОГРАФИКА ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(44px, 6.5vw, 96px);
  line-height: 0.92;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin: 0;
}

h1, .h1 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(36px, 5vw, 72px);
  line-height: 0.98;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  margin: 0;
}

h2, .h2 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(28px, 3.4vw, 48px);
  line-height: 1.04;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  margin: 0;
}

h3, .h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.2;
  margin: 0;
}

h4, .h4 {
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.35;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0;
}

h5, .h5 {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 12px;
  line-height: 1.3;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0;
}

.eyebrow {
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
  margin: 0;
}
.on-dark .eyebrow { color: var(--mute-dark); }

.body-sm {
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: var(--mute);
}
.on-dark .body-sm { color: var(--mute-dark); }

.caption {
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.06em;
  color: var(--mute);
}
.on-dark .caption { color: var(--mute-dark); }

.price {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums lining-nums;
}

.price-lg {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.2;
  font-variant-numeric: tabular-nums lining-nums;
}

.price-old {
  color: var(--mute);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  font-variant-numeric: tabular-nums;
}

.epigraph {
  font-family: var(--font-epigraph);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.35;
  margin: 0;
}

/* ---------- КНОПКИ ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 32px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 240ms ease-out, color 240ms ease-out;
}

.btn:hover {
  background: var(--ink);
  color: var(--paper);
}

.btn--on-dark {
  border-color: var(--paper);
  color: var(--paper);
}
.btn--on-dark:hover {
  background: var(--paper);
  color: var(--ink);
}

.btn--filled {
  background: var(--ink);
  color: var(--paper);
}
.btn--filled:hover {
  background: var(--accent-deep);
  color: var(--paper);
}

.btn--sm {
  height: 40px;
  padding: 0 20px;
  font-size: 12px;
}

.btn:disabled {
  border-color: var(--line-strong);
  color: var(--line-strong);
  cursor: not-allowed;
  background: transparent;
}

/* ---------- СЕТКА ---------- */
.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 64px;
}
@media (max-width: 1279px) { .wrap { padding: 0 40px; } }
@media (max-width: 1023px) { .wrap { padding: 0 32px; } }
@media (max-width: 767px)  { .wrap { padding: 0 20px; } }
@media (max-width: 479px)  { .wrap { padding: 0 16px; } }

.section {
  padding-top: var(--section-pad);
  padding-bottom: var(--section-pad);
}
.section--tight {
  padding-top: calc(var(--section-pad) / 2);
  padding-bottom: calc(var(--section-pad) / 2);
}

/* ---------- ХЕДЕР (3 состояния, приём Moncler) ---------- */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 88px;
  padding: 0 64px;
  background: transparent;
  color: var(--paper);
  transition: transform 280ms ease-out, background-color 280ms ease-out,
              color 280ms ease-out;
}

.header--scrolled {
  height: 64px;
  background: var(--paper);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}

.header--solid {
  background: var(--paper);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  height: 64px;
}

.header__logo {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: inherit;
  text-decoration: none;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.header__nav {
  display: flex;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.header__nav a {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: inherit;
  text-decoration: none;
}

.header__utils {
  display: flex;
  gap: 24px;
  align-items: center;
  margin-left: auto;
}

.header__utils a, .header__utils button {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.header__burger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: inherit;
}
.header__burger span {
  display: block;
  width: 22px;
  height: 1px;
  background: currentColor;
  margin: 6px 0;
  transition: transform 240ms ease-out, opacity 240ms ease-out;
}

@media (max-width: 1023px) {
  .header { padding: 0 32px; height: 64px; background: var(--paper); color: var(--ink); }
  .header__nav { display: none; }
  .header__burger { display: block; }
  .header__utils { gap: 16px; }
}

/* Мобильное меню — ИСПРАВЛЕНИЕ #11: по кнопке, не по hover */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--overlay);
  color: var(--paper);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px 32px;
  transform: translateY(-100%);
  transition: transform 360ms cubic-bezier(0.32, 0.72, 0, 1);
  visibility: hidden;
}
.mobile-menu--open {
  transform: translateY(0);
  visibility: visible;
}
.mobile-menu__close {
  position: absolute;
  top: 20px; right: 20px;
  background: none;
  border: none;
  color: var(--paper);
  font-size: 28px;
  cursor: pointer;
  padding: 8px;
  line-height: 1;
}
.mobile-menu nav { display: flex; flex-direction: column; gap: 24px; }
.mobile-menu nav a {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 36px;
  line-height: 1.1;
  text-transform: uppercase;
  color: var(--paper);
  text-decoration: none;
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero__media img,
.hero__media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.72;
}

.hero__content {
  position: relative;
  z-index: 1;
  padding: 0 64px 64px;
  max-width: 900px;
}
@media (max-width: 767px) {
  .hero__content { padding: 0 20px 48px; }
}

.hero__title {
  margin: 16px 0 20px;
}
.hero__sub {
  margin: 0 0 32px;
  max-width: 480px;
}

.hero__scroll {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 40px;
  background: var(--paper);
  opacity: 0.6;
  animation: breathe 2400ms ease-in-out infinite;
  z-index: 1;
}
@keyframes breathe {
  0%, 100% { transform: translateX(-50%) scaleY(0.4); opacity: 0.3; }
  50%      { transform: translateX(-50%) scaleY(1);   opacity: 0.8; }
}

/* ---------- ПОЛОСА ДОВЕРИЯ ---------- */
.trust {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  overflow-x: auto;
  scrollbar-width: none;
}
.trust::-webkit-scrollbar { display: none; }

.trust__item {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
  white-space: nowrap;
  padding: 0 24px;
  border-right: 1px solid var(--line);
}
.trust__item:last-child { border-right: none; }

@media (max-width: 767px) {
  .trust { justify-content: flex-start; padding: 0 16px; }
  .trust__item { padding: 0 16px; font-size: 11px; }
}

/* ---------- КАТЕГОРИИ (асимметрия, приём Bottega) ---------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}
@media (max-width: 767px) {
  .cat-grid { grid-template-columns: 1fr; gap: 16px; }
}

.cat-tile {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--paper-2);
  color: var(--paper);
  text-decoration: none;
  aspect-ratio: 3 / 4;
}
.cat-tile--wide { grid-column: span 7; aspect-ratio: 16 / 10; }
.cat-tile--narrow { grid-column: span 5; aspect-ratio: 16 / 10; }
.cat-tile--third { grid-column: span 4; }

@media (max-width: 767px) {
  .cat-tile--wide, .cat-tile--narrow, .cat-tile--third {
    grid-column: span 1;
    aspect-ratio: 3 / 4;
  }
}

.cat-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 320ms cubic-bezier(0.4, 0, 0.2, 1);
}
.cat-tile:hover img { opacity: 0.86; }

.cat-tile__label {
  position: absolute;
  left: 24px;
  bottom: 24px;
  z-index: 1;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(20px, 2.2vw, 32px);
  text-transform: uppercase;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 12px rgba(14,14,15,0.5);
}

/* ---------- КАРТОЧКА ТОВАРА ---------- */
.card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: transparent;
}

.card__media {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--paper-2);
  margin-bottom: 16px;
}

.card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 320ms cubic-bezier(0.4, 0, 0.2, 1);
}

.card__img--hover {
  position: absolute;
  inset: 0;
  opacity: 0;
}
.card:hover .card__img--hover { opacity: 1; }

.card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  background: rgba(14, 14, 15, 0.9);
  color: var(--paper);
  font-size: 12px;
  letter-spacing: 0.06em;
  padding: 5px 10px;
  font-variant-numeric: tabular-nums;
}

.card__name {
  margin: 0 0 4px;
  font-weight: 400;
  font-size: 15px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: transform 320ms cubic-bezier(0.4, 0, 0.2, 1);
}
.card:hover .card__name { transform: translateY(-2px); }

.card__meta {
  font-size: 14px;
  line-height: 1.5;
  color: var(--mute);
  margin: 0 0 8px;
}

/* Цвета */
.card__colors {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  cursor: pointer;
  padding: 0;
  background-clip: padding-box;
}
.color-dot--active {
  outline: 1px solid var(--ink);
  outline-offset: 3px;
}

/* Размеры — ИСПРАВЛЕНИЕ #11: не прячем за hover */
.card__sizes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}
.size-chip {
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 4px 8px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-ui);
}
.size-chip--out {
  color: var(--line-strong);
  border-color: var(--line);
  text-decoration: line-through;
  cursor: pointer;
}

/* Сетка каталога — асимметрия */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 32px 24px;
}
.catalog-grid > * { grid-column: span 4; }

/* Каждый 7-й — полноширинный редакционный тайл (ИСПРАВЛЕНИЕ #16) */
.catalog-grid > .catalog-wide {
  grid-column: span 12;
  aspect-ratio: 21 / 9;
  position: relative;
  overflow: hidden;
  margin: 24px 0;
}
.catalog-grid > .catalog-wide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 1023px) { .catalog-grid > * { grid-column: span 6; } }
@media (max-width: 767px)  {
  .catalog-grid { grid-template-columns: 1fr; }
  .catalog-grid > *, .catalog-grid > .catalog-wide { grid-column: span 1; aspect-ratio: auto; }
  .catalog-grid > .catalog-wide { aspect-ratio: 16 / 9; }
}

/* ---------- ФОРМЫ ---------- */
.input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  background: var(--paper-2);
  font-family: var(--font-ui);
  font-size: 15px;
  color: var(--ink);
  border-radius: 0;
}
.input::placeholder { color: var(--mute); }
.input:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: var(--accent);
}

/* ---------- ФУТЕР ---------- */
.footer {
  background: var(--ink);
  color: var(--paper);
  padding: var(--section-pad) 0 32px;
  position: relative;
  overflow: hidden;
}

.footer__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  margin-bottom: 64px;
}
@media (max-width: 767px) {
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

.footer__col h5 {
  color: var(--mute-dark);
  margin-bottom: 16px;
}
.footer__col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer__col a {
  font-size: 14px;
  color: var(--paper);
  opacity: 0.8;
  transition: opacity 240ms ease-out;
}
.footer__col a:hover { opacity: 1; color: var(--paper); }

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  padding-top: 32px;
  border-top: 1px solid rgba(244, 242, 238, 0.15);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--mute-dark);
}
.footer__bottom a { color: var(--mute-dark); }
.footer__bottom a:hover { color: var(--paper); }

.footer__watermark {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(64px, 18vw, 260px);
  line-height: 0.8;
  letter-spacing: -0.02em;
  color: var(--ink-2);
  text-transform: uppercase;
  text-align: center;
  margin-top: 48px;
  user-select: none;
  pointer-events: none;
}

/* ---------- ПАРТНЁРСКИЙ БЛОК STS ---------- */
.sts-block {
  background: var(--ink-2);
  color: var(--paper);
  padding: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
@media (max-width: 767px) { .sts-block { padding: 32px 24px; } }

/* ---------- АНИМАЦИЯ ПОЯВЛЕНИЯ ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 640ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 640ms cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal--in {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: opacity 120ms; }
}

/* ---------- УТИЛИТЫ ---------- */
.on-dark { color: var(--paper); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.text-center { text-align: center; }

/* Ленивая загрузка: держим пропорции */
.ratio-3-4 { aspect-ratio: 3 / 4; }
.ratio-9-16 { aspect-ratio: 9 / 16; }
.ratio-1-1 { aspect-ratio: 1 / 1; }
