/* ——— Премиальный слой: заставка, плечики с зажимами, свет в шкафу, ленты, цифры, цитата, анимации ———
   Новые цвета — только переменными ниже; базовые цвета и шрифты — из :root в style.css. */

:root {
  --wood-hi: #a5653a;
  --wood-mid: #6b3a1f;
  --wood-lo: #2f170b;
  --brass-hi: #fbe7a8;
  --gilt: linear-gradient(135deg, #f6e1a2 0%, var(--brass) 22%, var(--brass-dark) 45%, #eacf8a 62%, var(--brass) 80%, #6e5020 100%);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-curtain: cubic-bezier(.77, 0, .18, 1);
  /* дамаск: лилия и ромб на задней стенке шкафа */
  --damask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='130' viewBox='0 0 90 130'%3E%3Cg fill='none' stroke='%23e2c483' stroke-opacity='.08' stroke-width='1.2'%3E%3Cpath d='M45 10c11 15 24 24 24 41S56 79 45 90C34 79 21 68 21 51S34 25 45 10z'/%3E%3Cpath d='M45 34c5 7 11 11 11 19s-6 13-11 17c-5-4-11-9-11-17s6-12 11-19z'/%3E%3Cpath d='M0 65c11 0 18 7 18 18M90 65c-11 0-18 7-18 18M45 90v32M33 108h24M0 0l12 12M90 0 78 12M0 130l12-12M90 130l-12-12'/%3E%3C/g%3E%3C/svg%3E");
  /* кольцо орнамента вокруг герба */
  --ring: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cg fill='none' stroke='%23b88a3b'%3E%3Ccircle cx='100' cy='100' r='97' stroke-width='.7'/%3E%3Ccircle cx='100' cy='100' r='91' stroke-width='.5' stroke-dasharray='1.5 4'/%3E%3Ccircle cx='100' cy='100' r='85' stroke-width='.7'/%3E%3C/g%3E%3Cg fill='%23b88a3b'%3E%3Cpath d='M100 0l4 6-4 6-4-6z'/%3E%3Cpath d='M100 188l4 6-4 6-4-6z'/%3E%3Cpath d='M0 100l6-4 6 4-6 4z'/%3E%3Cpath d='M188 100l6-4 6 4-6 4z'/%3E%3Ccircle cx='31' cy='31' r='2.5'/%3E%3Ccircle cx='169' cy='31' r='2.5'/%3E%3Ccircle cx='31' cy='169' r='2.5'/%3E%3Ccircle cx='169' cy='169' r='2.5'/%3E%3C/g%3E%3C/svg%3E");
  /* филигранный угол */
  --corner: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke-width='1.5'%3E%3Cpath d='M3 117V3h114' stroke='%238b1a1a'/%3E%3Cpath d='M11 117V11h106' stroke='%23b88a3b'/%3E%3Cpath d='M3 46c24 0 43-19 43-43' stroke='%238b1a1a'/%3E%3Cpath d='M19 60c0-22 19-41 41-41' stroke='%23b88a3b'/%3E%3C/g%3E%3Cpath d='M25 25l7-7 7 7-7 7z' fill='%238b1a1a'/%3E%3C/svg%3E");
}


/* ——— заставка: багряные створки ——— */
.intro { position: fixed; inset: 0; z-index: 100; overflow: hidden; pointer-events: none; animation: intro-gone 0s linear 2.1s forwards; }
body { overflow-x: clip; } /* уехавшие створки и ленты не раздвигают страницу вбок */
.intro__panel {
  position: absolute; top: 0; bottom: 0; width: 50.5%;
  background: var(--orn-gold) center / 48px 24px repeat-y, var(--crimson-deep) var(--grain);
  background-size: 48px 24px, auto;
  animation: 1.05s var(--ease-curtain) 1s forwards;
}
.intro__panel--left { left: 0; border-right: 6px double var(--gold); background-position: right 14px top, 0 0; animation-name: curtain-left; }
.intro__panel--right { right: 0; border-left: 6px double var(--gold); background-position: left 14px top, 0 0; animation-name: curtain-right; }
.intro__mark {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%;
  display: grid; place-items: center; width: min(76vw, 340px); aspect-ratio: 1;
  animation: intro-mark .9s ease-out both, intro-mark-out .45s ease-in .85s forwards;
}
.intro__ring {
  position: absolute; inset: 0; border-radius: 50%;
  background: var(--ring) center / contain no-repeat, radial-gradient(closest-side, var(--crimson-deep) 88%, transparent);
  animation: spin 6s linear 1;
}
.intro__name { font: clamp(1.6rem, 6vw, 2.4rem)/1.15 var(--font-display); color: var(--gold-light); text-align: center; max-width: 9ch; }
@keyframes curtain-left { to { transform: translateX(-101%); } }
@keyframes curtain-right { to { transform: translateX(101%); } }
@keyframes intro-mark { from { opacity: 0; scale: .85; } }
@keyframes intro-mark-out { to { opacity: 0; scale: 1.08; } }
@keyframes intro-gone { to { visibility: hidden; } }
@keyframes spin { to { rotate: 360deg; } }

/* ——— полоса прокрутки страницы ——— */
.progress { position: fixed; top: 0; left: 0; right: 0; z-index: 40; height: 3px; pointer-events: none; }
.progress span {
  display: block; height: 100%; transform: scaleX(var(--p, 0)); transform-origin: left;
  background: linear-gradient(90deg, var(--crimson), var(--gold-light), var(--gold));
  box-shadow: 0 0 8px rgba(226, 196, 131, .8);
}

/* ——— кнопки: золотой отблеск ——— */
.btn, .cart-btn { position: relative; overflow: hidden; isolation: isolate; }
.btn::after, .cart-btn::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(110deg, transparent 25%, rgba(255, 236, 190, .5) 50%, transparent 75%);
  transform: translateX(-130%); transition: transform .9s var(--ease-out);
}
.btn:hover::after, .btn:focus-visible::after, .cart-btn:hover::after { transform: translateX(130%); }

/* ——— шапка: тень при прокрутке ——— */
.header { transition: box-shadow .3s, background-color .3s; }
.is-scrolled .header { box-shadow: 0 10px 30px -18px rgba(51, 25, 15, .6); }
.nav a:not(.btn) { position: relative; border-bottom: 0; }
.nav a:not(.btn)::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--crimson);
  transform: scaleX(0); transition: transform .35s var(--ease-out);
}
.nav a:not(.btn):hover::after { transform: scaleX(1); }

/* ——— первый экран ——— */
.hero { position: relative; isolation: isolate; overflow-x: clip; }
.hero::before, .hero::after {
  content: ''; position: absolute; top: clamp(.8rem, 2vw, 1.6rem); z-index: -1;
  width: clamp(64px, 9vw, 120px); aspect-ratio: 1; background: var(--corner) center / contain no-repeat; opacity: .85;
}
.hero::before { left: clamp(.6rem, 2vw, 1.6rem); }
.hero::after { right: clamp(.6rem, 2vw, 1.6rem); transform: scaleX(-1); }
.hero__center { position: relative; }
.hero__center::before { /* вращающееся кольцо за гербом */
  content: ''; position: absolute; left: 50%; top: 0; z-index: -1;
  width: min(118%, 30rem); aspect-ratio: 1; translate: -50% -6%;
  background: var(--ring) center / contain no-repeat; opacity: .55;
  animation: spin 90s linear infinite;
}
.hero__center::after { /* тёплое сияние */
  content: ''; position: absolute; left: 50%; top: 4%; z-index: -2; width: 30rem; max-width: 100%; aspect-ratio: 1; translate: -50% 0;
  background: radial-gradient(closest-side, rgba(226, 196, 131, .45), transparent);
  animation: glow 6s ease-in-out infinite alternate;
}
@keyframes glow { to { opacity: .55; scale: 1.08; } }

/* появление первого экрана после заставки */
.hero__center > * { animation: rise 1s var(--ease-out) both; }
.hero__center > :nth-child(1) { animation-delay: 1.45s; }
.hero__center > :nth-child(2) { animation-delay: 1.6s; }
.hero__center > :nth-child(3) { animation-delay: 1.7s; }
.hero__center > :nth-child(4) { animation-delay: 1.8s; }
.hero__center > :nth-child(5) { animation-delay: 1.9s; }
.hero__center > :nth-child(6) { animation-delay: 2s; }
.arch--left { animation: from-left 1.3s var(--ease-out) 1.35s both; }
.arch--right { animation: from-right 1.3s var(--ease-out) 1.45s both; }
@keyframes rise { from { opacity: 0; translate: 0 26px; } }
@keyframes from-left { from { opacity: 0; translate: -60px 30px; } }
@keyframes from-right { from { opacity: 0; translate: 60px 30px; } }

/* блик, пробегающий по арке */
.arch { overflow: hidden; }
.arch::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 240, 205, .45) 50%, transparent 65%);
  transform: translateX(-120%); animation: sheen 7s ease-in-out 3s infinite;
}
.arch--right::after { animation-delay: 4.5s; }
@keyframes sheen { 0%, 70% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }

/* золотые пылинки */
.motes { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.mote {
  position: absolute; left: var(--x); bottom: -12px; width: var(--s); height: var(--s); border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 236, 180, .95), rgba(226, 196, 131, .4) 45%, transparent 70%);
  opacity: 0; animation: drift var(--d) linear var(--delay) infinite;
}
@keyframes drift {
  10% { opacity: var(--o); }
  85% { opacity: calc(var(--o) * .7); }
  to { opacity: 0; transform: translate(var(--dx), calc(var(--rise) * -1)); }
}

/* ——— бегущая лента обетов ——— */
.band {
  overflow: hidden; position: relative;
  background: var(--crimson-deep) var(--grain);
  border-block: 4px double var(--gold);
}
.band::before, .band::after { /* растушёвка краёв */
  content: ''; position: absolute; top: 0; bottom: 0; z-index: 1; width: 12%; pointer-events: none;
}
.band::before { left: 0; background: linear-gradient(90deg, var(--crimson-deep), transparent); }
.band::after { right: 0; background: linear-gradient(-90deg, var(--crimson-deep), transparent); }
.marquee { display: flex; width: max-content; }
.band .pledges {
  flex-wrap: nowrap; justify-content: flex-start; gap: 0; padding: 1rem 0;
  border: 0; color: var(--gold-light); font-size: 1.1rem;
}
.band .pledges li { padding-inline: 1.6rem; white-space: nowrap; }
.band .pledges li::before { color: var(--gold); margin-right: 1.6rem; }
.marquee-on { animation: marquee var(--dur, 38s) linear infinite; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ——— шкаф: задняя стенка, пилястры, свет ——— */
.wardrobe {
  background:
    radial-gradient(ellipse 60% 50% at 50% 46%, rgba(255, 214, 140, .18), transparent 70%),
    var(--damask) center top / 90px 130px,
    var(--wood-grain),
    linear-gradient(var(--wood-light), var(--wood) 55%, #120703);
  box-shadow: inset 0 40px 60px -30px rgba(0, 0, 0, .8), inset 0 -60px 80px -40px rgba(0, 0, 0, .9);
}
.wardrobe::before, .wardrobe::after { /* резные пилястры по бокам */
  content: ''; position: absolute; top: 0; bottom: 0; z-index: 2; width: clamp(14px, 2.4vw, 34px); pointer-events: none;
  background:
    linear-gradient(90deg, transparent 40%, var(--brass) 40% 46%, transparent 46%),
    var(--wood-grain),
    linear-gradient(90deg, var(--wood-lo), var(--wood-mid) 50%, var(--wood-lo));
  box-shadow: 0 0 30px rgba(0, 0, 0, .7);
}
.wardrobe::before { left: 0; }
.wardrobe::after { right: 0; transform: scaleX(-1); }
.wardrobe > *:not(.motes) { position: relative; z-index: 1; }
.motes--wardrobe { z-index: 0; }

.wardrobe__stage::before { /* луч света сверху */
  content: ''; position: absolute; left: 50%; top: -3rem; z-index: 0; pointer-events: none;
  width: min(640px, 96vw); height: calc(100% + 3rem); translate: -50% 0;
  background: linear-gradient(rgba(255, 228, 165, .26), rgba(255, 228, 165, .06) 70%, transparent);
  clip-path: polygon(38% 0, 62% 0, 100% 100%, 0 100%);
  filter: blur(6px);
  animation: lamp 5s ease-in-out infinite alternate;
}
@keyframes lamp { to { opacity: .7; } }

/* латунная штанга с кронштейнами */
.rail {
  top: 4px; height: 11px; border-radius: 6px;
  background: linear-gradient(#fff3c8, var(--brass-hi) 15%, var(--brass) 45%, var(--brass-dark) 80%, #3e2c0d);
  box-shadow: 0 8px 14px rgba(0, 0, 0, .6), 0 1px 0 rgba(255, 255, 255, .25) inset;
  overflow: visible;
}
.rail::before, .rail::after {
  content: ''; position: absolute; top: -9px; width: 26px; height: 30px; border-radius: 4px;
  background: var(--gilt); box-shadow: 0 6px 10px rgba(0, 0, 0, .6);
}
.rail::before { left: clamp(14px, 2.4vw, 34px); }
.rail::after { right: clamp(14px, 2.4vw, 34px); }


/* ——— штанга с вещами боком: наведённая вещь поворачивается лицом, соседи расходятся ———
   --w ширина вещи; боком вещь занимает --slot; --side: −1 слева от лицевой, 1 справа (наклон врозь) */
.wardrobe__stage { margin-top: 2.6rem; }
.flip {
  --w: clamp(150px, 15vw, 230px);
  --slot: calc(var(--w) * .3);
  --tilt: 68deg;
  --ease-turn: cubic-bezier(.65, 0, .35, 1); /* мягко трогается и мягко встаёт; та же кривая — у прокрутки в main.js */
  --turn-ms: .75s;
  --lamp-space: clamp(112px, 15svh, 150px); /* место над штангой под лампу */
  --shade-w: calc(var(--w) * .62); --shade-h: calc(var(--w) * .62 * .25); /* золочёный светильник-«картинная лампа» (рисунок 120×30) */
  --lamp-gap: 24px; /* просвет между низом лампы и штангой */
  position: relative; padding-top: var(--lamp-space);
}
.flip__rod { /* прямая штанга из того же металла, что вешалка; верх штанги — во внутреннем изгибе крючка (5 % высоты вешалки) */
  position: absolute; left: clamp(.5rem, 4vw, 3rem); right: clamp(.5rem, 4vw, 3rem); top: calc(var(--lamp-space) - 1px + var(--w) * .0302); z-index: 0; height: 8px;
  border-radius: 4px; background: linear-gradient(var(--pewter-hi), var(--pewter) 45%, var(--pewter-dark));
  box-shadow: 0 3px 5px rgba(0, 0, 0, .16);
}
.flip__rod::before, .flip__rod::after { /* шары на концах, как наконечники плечиков */
  content: ''; position: absolute; top: 50%; width: 18px; height: 18px; translate: 0 -50%; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--pewter-hi), var(--pewter) 45%, var(--pewter-dark));
  box-shadow: 0 2px 4px rgba(0, 0, 0, .25);
}
.flip__rod::before { left: -9px; }
.flip__rod::after { right: -9px; }
/* светильник витрины (по ролику-референсу владельца): плоский диск из металла вешалки с золочёным гравированным
   пояском, снизу — светящееся кольцо; ровный столб тёплого света на вещь лицом; под вещью — такой же круглый
   постамент с подсвеченной кромкой. --lx (центр вещи) ставит main.js; свет смешивается «экраном» */
.flip__lamp {
  --lamp-disc: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 30'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23f3e6b0'/%3E%3Cstop offset='.35' stop-color='%23d9b866'/%3E%3Cstop offset='.7' stop-color='%23a07c34'/%3E%3Cstop offset='1' stop-color='%236e5222'/%3E%3C/linearGradient%3E%3ClinearGradient id='h' x1='0' x2='1'%3E%3Cstop offset='0' stop-color='%237d5e25'/%3E%3Cstop offset='.45' stop-color='%23efe0ab'/%3E%3Cstop offset='1' stop-color='%238a6a2a'/%3E%3C/linearGradient%3E%3CradialGradient id='b' cx='.38' cy='.32' r='.7'%3E%3Cstop offset='0' stop-color='%23fbf1c8'/%3E%3Cstop offset='.5' stop-color='%23cfa652'/%3E%3Cstop offset='1' stop-color='%236e5222'/%3E%3C/radialGradient%3E%3C/defs%3E%3Crect x='57.6' y='0' width='4.8' height='9' rx='1.6' fill='url%28%23h%29'/%3E%3Cellipse cx='60' cy='9.2' rx='9' ry='2.4' fill='url%28%23h%29'/%3E%3Crect x='16' y='10' width='88' height='13' rx='6.5' fill='url%28%23g%29'/%3E%3Cpath d='M22 13.4h76' stroke='%23fbf1c8' stroke-opacity='.55' stroke-width='.8'/%3E%3Cpath d='M20 16.5h80' stroke='%236e5222' stroke-opacity='.35' stroke-width='.6'/%3E%3Ccircle cx='15' cy='16.5' r='4' fill='url%28%23b%29'/%3E%3Ccircle cx='105' cy='16.5' r='4' fill='url%28%23b%29'/%3E%3Cellipse cx='60' cy='23.2' rx='40' ry='2' fill='%23fff4d6'/%3E%3Cellipse cx='60' cy='23.6' rx='42' ry='3.4' fill='%23ffe6a8' fill-opacity='.35'/%3E%3C/svg%3E");
  --lb: calc(var(--w) * .2); /* от низа штанги до подола вещи лицом — ставит main.js */
  position: absolute; top: 0; left: var(--lx, 50%); z-index: 3; width: 0; height: 100%; pointer-events: none;
  transition: left .35s ease-out; /* свет перескакивает к вещи быстро, не «едет» по соседям */
}
/* лампы нет (владелец убрал): свет падает сверху «из ниоткуда» — без светильника и подвеса */
.flip__cord, .flip__shade { display: none; }
.flip__cord { /* тонкий подвес */
  position: absolute; top: 0; left: -1.5px; width: 3px; height: calc(var(--lamp-space) - var(--lamp-gap) - var(--shade-h) + 4px);
  background: linear-gradient(90deg, #6e5222, #efe0ab, #7d5e25); /* золочёная штанга подвеса */
}
.flip__shade {
  position: absolute; top: calc(var(--lamp-space) - var(--lamp-gap) - var(--shade-h)); left: calc(var(--shade-w) / -2);
  width: var(--shade-w); height: var(--shade-h);
  background: var(--lamp-disc) center / contain no-repeat;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .45));
}
.flip__shade::after { /* тёплый отсвет под щелью светильника */
  content: ''; position: absolute; left: 50%; top: 62%; width: 110%; height: 70%; translate: -50% 0; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 232, 186, .35), rgba(255, 214, 150, .1) 55%, transparent);
  mix-blend-mode: screen;
}
.flip__beam { /* мягкое пятно света за вещью лицом: без луча и краёв — светлее у плеч, плавно уходит в темноту
   (владелец: трапеция-луч без источника смотрелась странно, резкая линия сверху) */
  position: absolute; left: 50%; translate: -50% 0; pointer-events: none;
  top: calc(var(--lamp-space) - var(--w) * .25);
  width: calc(var(--w) * 2.2);
  height: calc(100% - var(--lamp-space) + var(--w) * .25 - var(--lb) + var(--w) * .15);
  background: radial-gradient(ellipse 50% 46% at 50% 38%, rgba(255, 232, 192, .13), rgba(255, 226, 180, .06) 45%, transparent 75%);
  mix-blend-mode: screen;
  transition: height .35s ease-out;
}
.flip__lamp::after { /* мягкий отсвет на «полу» сразу под подолом — без постамента */
  content: ''; position: absolute; left: 0; translate: -50% 0; bottom: calc(var(--lb) - var(--w) * .16);
  width: calc(var(--w) * 1.3); height: calc(var(--w) * .14); border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 228, 180, .16), transparent); mix-blend-mode: screen;
  transition: bottom .35s ease-out;
}
@media (prefers-reduced-motion: reduce) { .flip__lamp { transition: none; } }

.flip__probe { position: absolute; left: 0; top: 0; height: 0; visibility: hidden; pointer-events: none; } /* щупы ширин для main.js */
.flip__items {
  position: relative; z-index: 1;
  display: flex; justify-content: center; align-items: flex-start;
  margin: 0; padding: 0 0 calc(var(--w) * .2);
  perspective: 1400px;
}
.flip__floor { /* мягкая тень под вещами */
  position: absolute; left: 10%; right: 10%; bottom: 0; height: calc(var(--w) * .3); pointer-events: none;
  background: radial-gradient(closest-side, rgba(43, 34, 29, .1), transparent);
}

/* боком: слот узкий, вещь развёрнута на --tilt; лицевая — во всю ширину и чуть крупнее */
.flip .hang {
  flex: 0 0 var(--slot); width: var(--slot); filter: none; transform: none;
  display: flex; justify-content: center;
  transition: flex-basis var(--turn-ms) var(--ease-turn), width var(--turn-ms) var(--ease-turn);
}
.flip .hang.is-front { flex-basis: calc(var(--w) * 1.18); width: calc(var(--w) * 1.18); }
.flip .hang__turn {
  flex: none; width: var(--w); transform-origin: 50% 0;
  transform: translateX(var(--fx, 0px)) rotateY(calc(var(--side, 1) * var(--tilt))) scale(.94);
  transition: transform var(--turn-ms) var(--ease-turn), filter var(--turn-ms) var(--ease-turn), opacity var(--turn-ms) var(--ease-turn);
  filter: brightness(.9) saturate(.9);
}
.flip .hang.is-front .hang__turn {
  transform: translateX(var(--fx, 0px)) rotateY(0deg) scale(1.06);
  filter: none;
}
.flip .hang:not(.is-front) .garment { cursor: pointer; }
.flip .hanger { /* фото вешалки 760×442: крючок на 48 % ширины (сдвиг 2 % ставит его по центру), плечи накрывают верх вещи */
  display: block; position: relative; z-index: 2; width: 100%; height: auto; translate: 2% 0;
  margin: 0 0 calc(var(--w) * -.175); filter: drop-shadow(0 4px 3px rgba(0, 0, 0, .22));
}
.flip .garment { gap: 0; }
.flip .garment__photo { margin-bottom: 0; }
.flip .garment__photo .badge { top: calc(var(--w) * .2); opacity: 0; transition: opacity .4s; } /* ниже плеч вешалки — плечи накрывают верх фото */
.flip .hang.is-front .garment__photo .badge { opacity: 1; }
.flip .hang:not(.is-front) .garment:hover .garment__photo { transform: none; }

/* авансцена: выбранная вещь в центре и крупнее, остальные расплываются и бледнеют */
.flip.is-focus .hang:not(.is-front) .hang__turn { filter: blur(6px) saturate(.6); opacity: .28; }
.flip.is-focus .hang.is-front .hang__turn { transform: translateX(var(--fx, 0px)) translateY(calc(var(--w) * .05)) scale(1.42); }
.flip.is-focus .flip__rod { opacity: .35; transition: opacity .6s; }
.flip__items { transition: padding-bottom var(--turn-ms) var(--ease-turn); }
.flip.is-focus .flip__items { padding-bottom: calc(var(--w) * .78); } /* место под увеличенной вещью: название и цена не прячутся */
.flip.is-focus .hang.is-front .garment { cursor: zoom-in; }

/* вырезанная вещь (поле cutout): без рамы, висит на плечиках сама */
.garment__photo--cut { aspect-ratio: 3 / 4; margin-top: calc(var(--w) * -.13); }
.cloth { position: absolute; inset: 0; transform-style: preserve-3d; }
.cloth__face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.cloth__face--back { transform: rotateY(180deg); }
.cloth__face img { width: 100%; height: 100%; object-fit: contain; object-position: 50% 0; filter: drop-shadow(0 22px 18px rgba(43, 34, 29, .3)); }
.cloth__face::after { /* объём: тень по бокам и блик, обрезанные по силуэту вещи */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(20, 10, 4, .2), transparent 22%, rgba(255, 248, 235, .14) 46%, transparent 66%, rgba(20, 10, 4, .24));
  -webkit-mask: var(--src) 50% 0 / contain no-repeat; mask: var(--src) 50% 0 / contain no-repeat;
}

/* вещь надета на плечики (cutout.fit): вешалка ЗА вещью — плечи под тканью, шарики в рукавах, над воротом
   только крючок и шейка. Вешалка у всех таких вещей одного размера (--hw от ширины слота), вещь — по своему крою:
   ширина = вешалка / --hs, верх — на --hy её ширины ниже верха вешалки, центр ворота --cx — под крючком */
.flip .hang--fit { --hw: .64; --gw: calc(var(--w) * var(--hw) / var(--hs)); }
.flip .hang--fit .hanger {
  position: relative; z-index: 0; width: calc(var(--w) * var(--hw)); translate: 0 0; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .3));
  margin: calc(var(--w) * .0302 * (1 - var(--hw))) auto calc(var(--hy) * var(--gw) - var(--w) * var(--hw) * .5816); /* крючок на штанге */
}
.flip .hang--fit .garment { /* кнопка: в Safari содержимое шире кнопки центрируется — вещь уезжала из-под крючка
   на (ширина вещи − слот)/2, а копия вешалки в вороте — вместе с ней (разрыв на ножке). Flex с началом слева — без центровки */
  display: flex; justify-content: flex-start; align-items: flex-start; position: relative; z-index: 1; width: var(--w);
}
.flip .hang--fit .garment__photo--cut { flex: none; }
.flip .hang--fit .garment__photo--cut {
  display: block; width: var(--gw); aspect-ratio: 1 / var(--ar); margin: 0 0 0 calc(var(--w) / 2 - var(--cx) * var(--gw));
}
.flip .hang--fit .cloth__face img { border: 0; aspect-ratio: auto; object-fit: fill; }
.flip .hang--fit .garment:hover .garment__photo, .flip .hang--fit .garment:focus-visible .garment__photo { transform: none; } /* не отрывать от плечиков */
/* вещь со спины: плечи вешалки скрыты спинкой — рисуем только крючок и ножку до орнамента, ничто не проступает над плечом */
.flip .hang--fit.hang--back .hanger { clip-path: polygon(30% 0, 70% 0, 70% 64%, 30% 64%); }

/* брюки: от вешалки остаются крючок, шейка и орнамент, вместо плеч — прямая перекладина металла вешалки,
   с неё на двух зажимах висит пояс. Перекладина — на уровне шариков орнамента (79,5 % высоты картинки вешалки) */
.flip .hang--clip { --hy: 0; /* без hy общий margin вешалки недействителен — она теряет центровку */ --hh: calc(var(--w) * var(--hw) * .5816); --cl: calc(var(--w) * .045); --clw: calc(var(--w) * .05); }
.flip .hang--fit.hang--clip .hanger {
  clip-path: polygon(34% 0, 66% 0, 66% 80%, 34% 80%);
  margin-bottom: calc(var(--hh) * -.205 + var(--cl));
}
/* верх пояса на снимке выгнут (сзади выглядывает задняя половина) — у прямой перекладины это смотрелось криво:
   срезаем 1,3 % сверху, пояс получается ровным, как стянутый зажимами */
.flip .hang--clip { --cut: calc(var(--gw) * var(--ar) * .013); --bar: calc(var(--w) * .024); }
.flip .hang--clip .cloth__face { clip-path: inset(1.3% 0 0 0); }
.flip .hang--clip .garment__photo--cut { margin-top: calc(var(--cut) * -1); }
.flip .hang--clip .clip-bar { /* перекладина — металл вешалки, по центру над поясом */
  position: absolute; z-index: 2; left: calc(var(--cx) * 100%); translate: -50% 0;
  top: calc(var(--cut) - var(--cl) - var(--bar) / 2); width: calc(var(--w) * var(--hw) * .92); height: var(--bar);
  border-radius: 99px; box-shadow: 0 2px 3px rgba(0, 0, 0, .4);
  background: linear-gradient(180deg, var(--pewter-hi), var(--pewter) 55%, var(--pewter-dark));
}
.flip .hang--clip .clip { /* зажим: корпус на перекладине, губки обхватывают кромку пояса */
  position: absolute; z-index: 3; width: calc(var(--w) * .036); translate: -50% 0;
  top: calc(var(--cut) - var(--cl) - var(--bar) * .2); height: calc(var(--cl) + var(--w) * .038);
  border-radius: 2px 2px 3px 3px;
  background:
    linear-gradient(transparent 58%, rgba(0, 0, 0, .45) 58% 62%, transparent 62%),
    linear-gradient(90deg, var(--pewter-dark), var(--pewter-hi) 38%, var(--pewter) 70%, var(--pewter-dark));
  box-shadow: 0 2px 3px rgba(0, 0, 0, .45);
}
.flip .hang--clip .clip::after { /* тень и складка ткани под губками */
  content: ''; position: absolute; left: -60%; right: -60%; top: 100%; height: calc(var(--w) * .05);
  background: radial-gradient(ellipse 50% 70% at 50% 0, rgba(0, 0, 0, .35), transparent);
}
.flip .hang--clip .clip--l { left: calc((var(--cx) - var(--clip) * .42) * 100%); }
.flip .hang--clip .clip--r { left: calc((var(--cx) + var(--clip) * .42) * 100%); }

/* поворот на 360° (вещь с лицом и спиной): спиной — пауза — снова лицом. Спина во всю ширину, подол может быть
   ниже переда (спинку снимают длиннее). Пока вещь крутится, вешалку в вороте прячем — она нарисована на лицевой стороне */
.flip .hang--fit .garment__photo--cut { perspective: 900px; }
.flip .hang--fit .cloth__face--back img { height: auto; }
/* Safari не прячет обратную сторону, если на картинке filter (drop-shadow): лицо просвечивало зеркально поверх спины.
   Поэтому стороны переключаются явно: поворот разбит на четверти (90° ровно на 20 % и 80 % времени), в эти моменты
   лицо и спина меняются местами скачком. Спина в покое скрыта совсем */
.cloth__face--back { opacity: 0; }
.cloth.is-spinning { animation: cloth-spin 3s linear; }
@keyframes cloth-spin {
  0%   { transform: rotateY(0);      animation-timing-function: cubic-bezier(.5, 0, .9, .55); }
  20%  { transform: rotateY(90deg);  animation-timing-function: cubic-bezier(.1, .45, .5, 1); }
  40%  { transform: rotateY(180deg); }
  60%  { transform: rotateY(180deg); animation-timing-function: cubic-bezier(.5, 0, .9, .55); }
  80%  { transform: rotateY(270deg); animation-timing-function: cubic-bezier(.1, .45, .5, 1); }
  100% { transform: rotateY(360deg); }
}
.cloth.is-spinning .cloth__face--front { animation: face-front 3s step-end; }
.cloth.is-spinning .cloth__face--back { animation: face-back 3s step-end; }
@keyframes face-front { 0% { opacity: 1; } 20% { opacity: 0; } 80%, 100% { opacity: 1; } }
@keyframes face-back { 0% { opacity: 0; } 20% { opacity: 1; } 80%, 100% { opacity: 0; } }
.garment.is-spinning .badge { opacity: 0; transition: opacity .25s; } /* спинка длиннее переда — плашка легла бы на неё */
.garment .badge { transition: opacity .4s .1s; }
.garment.is-spinning .cloth__inside { opacity: 0; transition: opacity .25s; }
.cloth__inside { transition: opacity .4s .1s; }
@media (prefers-reduced-motion: reduce) { .cloth.is-spinning { animation-duration: .01s; } }

/* та же вешалка поверх вещи, обрезанная вырезом ворота (clip-path из fit.neck): совпадает с задней пиксель в пиксель */
.flip .hang--fit .cloth__inside { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.flip .hang--fit .cloth__inside .hanger {
  position: absolute; margin: 0; translate: 0 0; z-index: auto; height: auto; aspect-ratio: 760 / 442; border: 0; object-fit: fill; /* не правила фото вещи (.garment__photo img: 3:4, обрезка, рамка) */
  left: calc((var(--cx) - var(--hs) / 2) * 100%); top: calc(var(--hy) / var(--ar) * -100%); width: calc(var(--hs) * 100%);
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .3)); /* тот же тон, что у задней вешалки, — без ступеньки на ножке */
}
.flip .hang--fit .cloth__layer { position: absolute; inset: 0; }
.flip .hang--fit .cloth__inside .hanger--shade { filter: brightness(.4) drop-shadow(0 3px 3px rgba(0, 0, 0, .3)); }
.flip .hang--fit .garment__photo .badge { z-index: 2;  top: auto; bottom: -2.4rem; left: 50%; right: auto; translate: -50% 0; white-space: nowrap; } /* под подолом: на груди закрывала вышивку */

/* телефон: штанга листается пальцем, лицом — вещь посередине */
@media (max-width: 760px) {
  .flip { --w: min(56vw, 240px); --slot: calc(var(--w) * .34); --tilt: 64deg; }
  .flip__items {
    justify-content: flex-start; overflow-x: auto; overscroll-behavior-x: contain;
    scrollbar-width: none; /* без scroll-snap: к центру доводит main.js по итоговым ширинам (snap срабатывал посреди анимации — вещь вставала криво) */
    padding-inline: calc(50% - var(--w) * .59);
  }
  .flip__items::-webkit-scrollbar { display: none; }
  .flip__rod { left: 10px; right: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .flip .hang, .flip .hang__turn { transition: none; }
}

/* отступ сверху раньше давала орнаментная лента (её убрали) — без него заголовок прилипает к бегущей ленте */
.wardrobe { padding-top: clamp(2.6rem, 6vw, 4.5rem); }

/* ——— человек с принта: портрет, год, город, событие и врезка-карта, где горит его город ———
   Карта — маленькая врезка в карточке, а не фон: фоном она ложилась под вещи и текст. */
/* узкий экран: портрет с текстом и врезка рядом, под ценой; место зарезервировано — кнопка не прыгает */
.figure { display: flex; justify-content: center; align-items: stretch; gap: .6rem; width: min(440px, 100%); min-height: 92px; }
.figure > * {
  opacity: 0; visibility: hidden; translate: 0 6px;
  transition: opacity .45s, translate .45s var(--ease-out), visibility 0s .45s;
}
.figure.is-shown > * { opacity: 1; visibility: visible; translate: 0 0; transition: opacity .45s, translate .45s var(--ease-out); }
.map__card {
  display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: .75rem; align-items: center;
  flex: 1 1 auto; max-width: 330px; padding: .5rem .8rem .5rem .6rem; text-align: left;
  color: var(--ink); background: color-mix(in srgb, var(--milk, #fbf5ea) 92%, transparent);
  border: 1px solid var(--line, rgba(43, 34, 29, .13)); box-shadow: 0 14px 30px -22px rgba(43, 34, 29, .45);
}
.map__portrait {
  width: 54px; height: 54px; border-radius: 50%; object-fit: cover;
  box-shadow: 0 0 0 1px var(--brass), 0 0 0 4px var(--milk, #fbf5ea), 0 0 0 5px color-mix(in srgb, var(--brass) 50%, transparent);
}
.map__text { display: grid; gap: .1rem; }
.map__year { font: 1.5rem/1 var(--font-display); color: var(--crimson); }
.map__place { font: .78rem var(--font-title); letter-spacing: .2em; text-transform: uppercase; color: var(--gold-text); }
.map__event { font: italic .88rem/1.25 var(--font-text); color: var(--ink-soft); }

/* врезка-карта: квадрат в тонкой латунной рамке, как фрагмент атласа */
.map__inset {
  position: relative; flex: none; width: 112px; aspect-ratio: 1; align-self: center; overflow: hidden;
  background: color-mix(in srgb, var(--parchment) 70%, var(--milk, #fbf5ea));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brass) 70%, transparent), inset 0 0 0 3px var(--milk, #fbf5ea);
}
.map__svg { display: block; width: 100%; height: 100%; }
/* подпись города на врезке — картуш внизу, как в атласе: точки городов выше него, текст всегда читается */
.map__label {
  position: absolute; left: 4px; right: 4px; bottom: 4px; padding: .12rem .2rem .08rem;
  font: .74rem/1.15 var(--font-title); letter-spacing: .04em; text-align: center; color: var(--crimson);
  background: color-mix(in srgb, var(--milk, #fbf5ea) 90%, transparent);
  border-top: 1px solid color-mix(in srgb, var(--brass) 55%, transparent);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.map__land { fill: color-mix(in srgb, var(--sand, #dcc9aa) 80%, var(--parchment)); stroke: var(--brass-dark); stroke-width: 1.6; stroke-linejoin: round; }
.map__grat { fill: none; stroke: var(--brass); stroke-width: .5; stroke-dasharray: 1.5 3; opacity: .6; }
.map__pin .map__dot { fill: var(--ink-soft); opacity: .4; scale: .6; transform-box: fill-box; transform-origin: center; transition: fill .3s, opacity .3s; }
.map__pin .map__ring { fill: none; stroke: var(--crimson); stroke-width: 2.4; opacity: 0; transform-box: fill-box; transform-origin: center; }
.map__pin .map__name { display: none; }
.map__pin.is-on .map__dot { fill: var(--crimson); opacity: 1; scale: 1; }
.map__pin.is-on .map__ring { animation: pin-pulse 2.2s ease-out infinite; }
@keyframes pin-pulse { from { opacity: .9; scale: .5; } to { opacity: 0; scale: 2.2; } }

@media (max-width: 480px) {
  .map__card { column-gap: .6rem; padding-right: .6rem; }
  .map__portrait { width: 46px; height: 46px; }
  .map__inset { width: 100px; }
  .map__label { font-size: .68rem; letter-spacing: 0; }
  .map__year { font-size: 1.35rem; }
}
@media (prefers-reduced-motion: reduce) {
  .map__pin.is-on .map__ring { animation: none; opacity: .6; }
}

/* витрина вещи, что стоит впереди */
.showcase { position: relative; z-index: 3; display: grid; justify-items: center; gap: 1rem; padding: 0 1rem; text-align: center; }
/* широкий экран: карточка человека — по бокам от названия, на одной высоте с ним: видна вместе со штангой даже
   на невысоком ноутбуке (под ценой она уходила за низ экрана) */
@media (min-width: 900px) {
  .showcase { grid-template-columns: 1fr auto 1fr; column-gap: clamp(1rem, 2.5vw, 2.4rem); }
  .showcase > * { grid-column: 2; }
  .showcase > .showcase__info { grid-row: 1; }
  /* портрет с текстом — слева от названия, врезка-карта — справа: название посередине, всем просторно */
  .showcase > .figure { display: contents; }
  .figure > .map__card { grid-column: 1; grid-row: 1; justify-self: end; align-self: center; width: min(330px, 100%); }
  .figure > .map__inset { grid-column: 3; grid-row: 1; justify-self: start; align-self: center; width: clamp(112px, 10vw, 140px); }
}
.showcase__info { display: grid; gap: .2rem; min-height: 7.4rem; align-content: center; }
.showcase__info.is-changing { animation: showcase-in .6s var(--ease-out); }
@keyframes showcase-in { from { opacity: 0; translate: 0 10px; filter: blur(3px); } }
.showcase__category { font: .85rem var(--font-title); letter-spacing: .34em; text-transform: uppercase; color: var(--brass); }
.showcase__name { font: clamp(1.6rem, 3.4vw, 2.4rem)/1.15 var(--font-title); color: var(--parchment); text-wrap: balance; max-width: 26ch; }
.showcase__price { font: clamp(1.3rem, 2.4vw, 1.7rem) var(--font-title); color: var(--gold-light); }

/* ——— вещь в золочёной раме ——— */
.garment__photo.frame {
  padding: 7px; border: 1px solid #3e2c0d; background: var(--gilt);
  outline: 1px solid rgba(226, 196, 131, .35); outline-offset: 5px;
  box-shadow: 0 40px 50px -26px rgba(0, 0, 0, .95), 0 0 0 1px rgba(0, 0, 0, .4) inset;
  transform: translateY(var(--lift, 0)) rotateX(var(--tx, 0deg)) rotateY(var(--ty, 0deg));
  transform-style: preserve-3d;
  transition: transform .5s var(--ease-out), box-shadow .5s;
}
.garment__photo img, .garment__photo .no-photo { border: 1px solid #3e2c0d; }
.garment:hover .garment__photo, .garment:focus-visible .garment__photo { transform: translateY(-10px) rotateX(var(--tx, 0deg)) rotateY(var(--ty, 0deg)); }
.garment__glare { /* блик стекла, бегущий за курсором */
  position: absolute; inset: 7px; pointer-events: none; overflow: hidden;
  background: radial-gradient(circle at var(--gx, 30%) var(--gy, 20%), rgba(255, 240, 210, .28), transparent 45%);
  opacity: 0; transition: opacity .4s;
}
.hang.is-front .garment__glare { opacity: 1; }
.garment__photo .badge { top: 26px; z-index: 2; }

/* ценник на нитке */
.tag {
  position: absolute; top: 18%; right: -20px; z-index: 3;
  transform-origin: 50% -26px; rotate: 7deg;
  animation: tag-swing 3.4s ease-in-out infinite alternate;
}
.tag::before { /* нитка к зажиму */
  content: ''; position: absolute; left: 50%; bottom: calc(100% - 9px); width: 1.5px; height: 34px;
  background: var(--crimson); rotate: -18deg; transform-origin: bottom;
}
.tag__card {
  display: grid; justify-items: center; gap: .05rem; min-width: 5.2rem; padding: 1.25rem .7rem .55rem;
  color: var(--crimson-deep); background: var(--parchment) var(--grain);
  clip-path: polygon(18% 0, 82% 0, 100% 16%, 100% 100%, 0 100%, 0 16%);
  box-shadow: 0 0 0 1px var(--gold) inset;
  filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .5));
  background-image: radial-gradient(circle at 50% 9px, var(--wood) 3px, transparent 3.5px), var(--grain);
}
.tag__label { font: .62rem var(--font-title); letter-spacing: .24em; text-transform: uppercase; color: var(--gold-text); }
.tag__price { font: 1.05rem/1.1 var(--font-title); white-space: nowrap; }
@keyframes tag-swing { from { rotate: 3deg; } to { rotate: 11deg; } }

.garment__name { transition: color .3s; }
.hang.is-front .garment__name { color: var(--gold-light); }
.garment__cta {
  margin-top: .3rem; font: .85rem var(--font-title); letter-spacing: .3em; text-transform: uppercase; color: var(--brass);
  opacity: 0; translate: 0 6px; transition: opacity .4s, translate .4s var(--ease-out);
}
.hang.is-front .garment__cta { opacity: 1; translate: 0 0; }

.rack__nav { transition: transform .25s var(--ease-out), box-shadow .25s; }
.rack__nav:hover { box-shadow: 0 0 0 3px var(--wood), 0 0 0 4px var(--brass), 0 0 24px rgba(226, 196, 131, .6); }

/* счётчик под штангой */
.rack__meta {
  display: flex; align-items: center; justify-content: center; gap: 1rem;
  margin-top: .4rem; font: 1.1rem var(--font-title); letter-spacing: .14em; color: var(--brass);
}
.rack__bar { position: relative; width: min(260px, 50vw); height: 2px; background: rgba(201, 162, 86, .25); }
.rack__bar span {
  position: absolute; inset: 0 auto 0 0; width: var(--rp, 10%); background: var(--gold-light);
  box-shadow: 0 0 10px rgba(226, 196, 131, .8); transition: width .5s var(--ease-out);
}
#rack-index { color: var(--gold-light); }

/* ——— цифры ——— */
.facts {
  padding: clamp(2.6rem, 6vw, 4rem) clamp(1rem, 4vw, 3rem);
  background: var(--parchment-deep) var(--grain);
  border-bottom: 1px solid color-mix(in srgb, var(--crimson) 30%, transparent);
}
.facts__list { display: grid; grid-template-columns: repeat(4, 1fr); max-width: 1180px; margin: 0 auto; }
.facts__list li { display: grid; justify-items: center; gap: .4rem; padding: .6rem 1rem; text-align: center; }
.facts__list li + li { border-left: 1px solid color-mix(in srgb, var(--gold) 55%, transparent); }
.facts__num { font: clamp(2.4rem, 5vw, 3.6rem)/1 var(--font-display); color: var(--crimson); font-variant-numeric: tabular-nums; }
.facts__label { max-width: 15rem; font-size: 1rem; line-height: 1.45; font-style: italic; color: var(--ink-soft); }
.js .facts__list li.reveal:nth-child(2) { transition-delay: .1s; }
.js .facts__list li.reveal:nth-child(3) { transition-delay: .2s; }
.js .facts__list li.reveal:nth-child(4) { transition-delay: .3s; }

/* ——— лента образов ——— */
.lookbook { padding: clamp(3.5rem, 8vw, 6rem) 0; overflow: hidden; background: var(--parchment-deep) var(--grain); border-block: 1px solid color-mix(in srgb, var(--crimson) 30%, transparent); }
.lookbook .section__head { padding-inline: 1rem; }
.lookbook__row { overflow: hidden; padding-block: .9rem; }
.lookbook__row + .lookbook__row { margin-top: .4rem; }
.lookbook__track { display: flex; gap: clamp(.9rem, 2vw, 1.6rem); padding-right: clamp(.9rem, 2vw, 1.6rem); }
.lookbook__row--reverse .marquee-on { animation-direction: reverse; }
.lookbook__row:hover .marquee-on { animation-play-state: paused; }
.look {
  display: block; width: clamp(150px, 18vw, 240px); padding: 6px; cursor: pointer;
  background: var(--parchment); border: 1px solid var(--crimson); outline: 1px solid var(--gold); outline-offset: 3px;
  transition: transform .5s var(--ease-out), box-shadow .5s;
}
.look img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; filter: sepia(.35) saturate(.85); transition: filter .5s, transform .8s var(--ease-out); }
.look:hover, .look:focus-visible { transform: translateY(-8px) rotate(-1deg); box-shadow: 0 26px 30px -18px rgba(51, 25, 15, .7); }
.look:hover img, .look:focus-visible img { filter: none; }

/* ——— цитата ——— */
.quote {
  position: relative; overflow: hidden; isolation: isolate;
  padding: clamp(4rem, 10vw, 7rem) clamp(1rem, 4vw, 3rem);
  color: var(--parchment); text-align: center;
  background:
    radial-gradient(ellipse 60% 70% at 50% 50%, rgba(226, 196, 131, .14), transparent 70%),
    var(--crimson-deep) var(--grain);
  border-block: 6px double var(--gold);
}
.quote::before { /* медленно вращающееся кольцо */
  content: ''; position: absolute; left: 50%; top: 50%; z-index: -1; width: min(640px, 120vw); aspect-ratio: 1;
  translate: -50% -50%; background: var(--ring) center / contain no-repeat; opacity: .35;
  animation: spin 120s linear infinite reverse;
}
.quote__inner { position: relative; max-width: 50rem; margin: 0 auto; }
.quote__mark { display: block; font: 6rem/.6 var(--font-display); color: var(--gold); }
.quote blockquote { margin: 1rem 0 0; }
.quote blockquote p { font: clamp(1.7rem, 4vw, 3rem)/1.3 var(--font-display); color: var(--gold-light); text-wrap: balance; }
.quote figcaption { margin-top: 1.6rem; font: 1.1rem var(--font-title); letter-spacing: .3em; text-transform: uppercase; color: var(--parchment); opacity: .85; }
.quote figcaption::before, .quote figcaption::after { content: '—'; margin-inline: .8rem; color: var(--gold); }

/* ——— появление: шторка на фото, прорисовка разделителей ——— */
.js .story.reveal img, .js .details__strip .reveal img {
  clip-path: inset(100% 0 0 0); scale: 1.15;
  transition: clip-path 1.3s var(--ease-curtain), scale 1.8s var(--ease-out);
}
.js .story.reveal .story__detail img { transition-delay: .35s; }
.js .story.reveal.is-visible img, .js .details__strip .reveal.is-visible img { clip-path: inset(0); scale: 1; }
.js .details__strip li.reveal:nth-child(2) { transition-delay: .12s; }
.js .details__strip li.reveal:nth-child(3) { transition-delay: .24s; }
.js .details__strip li.reveal:nth-child(4) { transition-delay: .36s; }
.js .story__year { transition: letter-spacing 1.6s var(--ease-out), opacity 1.6s; }
.js .story.reveal:not(.is-visible) .story__year { letter-spacing: .4em; opacity: 0; }

.js .section__head.reveal .divider::before, .js .section__head.reveal .divider::after {
  transform: scaleX(0); transition: transform 1.1s var(--ease-out) .25s;
}
.js .section__head.reveal .divider::before { transform-origin: right; }
.js .section__head.reveal .divider::after { transform-origin: left; }
.js .section__head.reveal.is-visible .divider::before, .js .section__head.reveal.is-visible .divider::after { transform: scaleX(1); }
.js .section__head.reveal .divider span { display: inline-block; transition: rotate 1.2s var(--ease-out) .2s; }
.js .section__head.reveal:not(.is-visible) .divider span { rotate: -180deg; }

/* фото историй с лёгким параллаксом */
.story__detail { translate: 0 var(--py, 0); transition: translate .2s linear; }

/* ——— прочие оживления ——— */
.steps li { transition: transform .4s var(--ease-out); }
.steps li:hover { transform: translateY(-6px); }
.steps li::before { transition: background-color .4s, color .4s; }
.steps li:hover::before { color: var(--crimson-deep); background: var(--gold-light); }
.contact { transition: background .3s, color .3s, transform .4s var(--ease-out); }
.contact:hover { transform: translateY(-4px); }
.details__strip figure { overflow: hidden; }
.details__strip li:hover img { scale: 1.06; transition: scale .8s var(--ease-out); }

/* окно вещи: резные створки и проявление */
.door::before {
  content: ''; position: absolute; inset: 7% 16%;
  border: 2px solid var(--brass-dark);
  box-shadow: inset 0 0 0 6px rgba(0, 0, 0, .25), inset 0 0 0 7px rgba(201, 162, 86, .55), 0 0 0 6px rgba(0, 0, 0, .2);
  background: var(--damask) center / 90px 130px;
}
.door::after { width: 12px; height: 78px; box-shadow: 0 4px 8px rgba(0, 0, 0, .6); }
.modal.is-opening .modal__body { animation: reveal-body .9s var(--ease-out) .25s both; }
@keyframes reveal-body { from { opacity: 0; scale: .97; filter: blur(4px); } }
.gallery__main img { animation: photo-in .55s ease-out; }
@keyframes photo-in { from { opacity: 0; scale: 1.03; } }
.cart-line { animation: line-in .4s var(--ease-out) both; }
@keyframes line-in { from { opacity: 0; translate: 16px 0; } }

/* ——— узкие экраны ——— */
@media (max-width: 900px) {
  .facts__list { grid-template-columns: repeat(2, 1fr); row-gap: 1.6rem; }
  .facts__list li:nth-child(3) { border-left: 0; }
}
@media (max-width: 760px) {
  .wardrobe::before, .wardrobe::after { display: none; }
  .rail::before, .rail::after { display: none; }
  .tag { right: -12px; }
  .tag__card { min-width: 4.4rem; padding: 1.1rem .5rem .45rem; }
  .tag__price { font-size: .92rem; }
  .band .pledges { font-size: .95rem; padding-block: .8rem; }
  .hero::before, .hero::after { opacity: .6; }
  .hero__center::before { width: min(88vw, 22rem); translate: -50% -2%; opacity: .4; }
  .quote__mark { font-size: 4.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .intro { display: none; }
  .hero__center > *, .arch, .arch::after, .hero__center::before, .hero__center::after,
  .mote, .marquee-on, .tag, .quote::before, .wardrobe__stage::before, .intro__ring { animation: none !important; }
  .mote { display: none; }
  .lookbook__row { overflow-x: auto; }
  .js .story.reveal img, .js .details__strip .reveal img { clip-path: none; scale: 1; }
}

/* ═══ Первый экран: резной шкаф, створки распахиваются по прокрутке ═══ */
.gate { position: relative; height: 100vh; height: 100svh; background: #120404; }
.js .gate { height: 240vh; }
.gate__sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; perspective: 1500px; }
.gate__inside {
  --p: inherit;
  position: absolute; inset: 0;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); align-items: center;
  gap: clamp(1.5rem, 4vw, 4rem);
  padding: clamp(5.5rem, 12vh, 8rem) clamp(1.2rem, 6vw, 6rem) clamp(2rem, 6vh, 4rem);
  color: var(--parchment);
  background:
    radial-gradient(ellipse 45% 60% at 74% 50%, rgba(226, 196, 131, .3), transparent 70%),
    radial-gradient(ellipse 70% 80% at 25% 55%, rgba(139, 26, 26, .55), transparent 75%),
    var(--damask) center / 90px 130px,
    linear-gradient(#2c0808, #120404);
}
.js .gate__inside { transform: scale(calc(1.12 - var(--p, 0) * .12)); filter: brightness(calc(.3 + var(--p, 0) * .7)); }
.gate__text { position: relative; z-index: 2; max-width: 40rem; }
.gate__eyebrow { font: .95rem var(--font-title); letter-spacing: .4em; text-transform: uppercase; color: var(--brass); }
.gate__title { margin: .6rem 0 0; font: 400 clamp(3rem, 7.2vw, 7rem)/.95 var(--font-display); }
.gate__title span, .gate__plaque-title { /* золотое тиснение с переливом */
  display: inline-block;
  background: linear-gradient(100deg, #7d5e24 0%, #f6e1a2 18%, #b88a3b 34%, #fff6d6 48%, #c9a256 60%, #7d5e24 78%, #eacf8a 100%);
  background-size: 220% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, .55));
  animation: foil 7s linear infinite;
}
/* золото закрашивает только рамку строки: рамка всегда по ширине текста плюс запас под выносные штрихи вязи */
.gate__title span { display: block; width: max-content; max-width: none; padding: 0 .08em .06em; margin-left: -.08em; }
@keyframes foil { to { background-position: -220% center; } }
.gate__tagline { margin-top: 1.2rem; font: clamp(1.1rem, 2vw, 1.55rem) var(--font-title); letter-spacing: .22em; text-transform: uppercase; color: var(--gold-light); }
.gate .divider { margin: 1.2rem 0 0; color: var(--gold); }
.gate__lead { margin-top: 1.2rem; max-width: 32rem; font-size: 1.15rem; font-style: italic; color: color-mix(in srgb, var(--parchment) 86%, transparent); }
.gate__actions { justify-content: flex-start; }
.gate .btn--ghost { color: var(--gold-light); box-shadow: inset 0 0 0 3px transparent, inset 0 0 0 4px color-mix(in srgb, var(--gold) 60%, transparent); border-color: var(--gold); }
.gate .btn--ghost:hover { color: var(--crimson-deep); background: var(--gold-light); }
.gate :focus-visible { outline-color: var(--gold-light); }

/* текст проступает, пока створки расходятся */
.js .gate__text > * { opacity: clamp(0, calc((var(--p, 0) - var(--d, .3)) * 4), 1); translate: 0 calc((1 - var(--p, 0)) * 50px); }
.js .gate__text > :nth-child(1) { --d: .30; }
.js .gate__text > :nth-child(2) { --d: .36; }
.js .gate__text > :nth-child(3) { --d: .44; }
.js .gate__text > :nth-child(4) { --d: .48; }
.js .gate__text > :nth-child(5) { --d: .52; }
.js .gate__text > :nth-child(6) { --d: .56; }

/* киот с портретами */
.gate__kiot {
  position: relative; z-index: 1; justify-self: center;
  width: min(100%, 25rem); aspect-ratio: 3 / 4.3; padding: 10px;
  border-radius: 999px 999px 0 0; background: var(--gilt);
  box-shadow: 0 0 0 1px #3e2c0d, 0 0 0 9px rgba(18, 4, 4, .92), 0 0 0 10px var(--brass), 0 0 90px rgba(226, 196, 131, .38), 0 50px 70px -24px #000;
}
.js .gate__kiot { translate: 0 calc((1 - var(--p, 0)) * 80px); }
.gate__kiot::before { /* золотое кольцо-сияние за киотом */
  content: ''; position: absolute; left: 50%; top: 32%; z-index: -1; width: 165%; aspect-ratio: 1; translate: -50% -50%;
  background: var(--ring) center / contain no-repeat; opacity: .5; animation: spin 80s linear infinite;
}
.gate__window { position: relative; height: 100%; overflow: hidden; border-radius: 999px 999px 0 0; background: #120404; box-shadow: 0 0 0 1px #3e2c0d; }
.gate__window::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 60px 10px rgba(18, 4, 4, .75); border-radius: inherit; pointer-events: none; }
.gate__slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; opacity: 0; transition: opacity 1.8s ease; }
.gate__slide.is-active { opacity: 1; animation: kenburns 7.5s ease-out both; }
@keyframes kenburns { from { scale: 1.16; } to { scale: 1; } }

/* створки */
.gate__doors { display: none; position: absolute; inset: 0; z-index: 5; pointer-events: none; perspective: 1500px; }
.js .gate__doors { display: block; }
.gate.is-open .gate__doors { visibility: hidden; }
.js .gate__doors { opacity: clamp(0, calc((1 - var(--p, 0)) * 7), 1); } /* распахнутые створки тают — по краям не остаются полоски */
.gate__door {
  --open: calc(.035 + var(--p, 0) * .965);
  position: absolute; top: 0; bottom: 0; width: 50%;
  display: grid; grid-template-rows: 1.75fr 1fr; gap: clamp(1rem, 3vh, 2rem);
  padding: clamp(6rem, 14vh, 8.5rem) clamp(1.2rem, 4.5vw, 4rem) clamp(2rem, 6vh, 4rem);
  background:
    var(--damask) center / 90px 130px,
    var(--wood-grain),
    linear-gradient(90deg, var(--wood-lo), var(--wood-mid) 50%, var(--wood-lo));
  box-shadow: inset 0 0 0 10px var(--wood-lo), inset 0 0 0 12px var(--brass-dark), inset 0 0 0 13px var(--brass), inset 0 0 120px rgba(0, 0, 0, .65);
}
.gate__door::before { /* тень на створке по мере поворота */
  content: ''; position: absolute; inset: 0; z-index: 3; background: #000; opacity: calc(var(--p, 0) * .7); pointer-events: none;
}
.gate__door--left { left: 0; transform-origin: left center; transform: rotateY(calc(var(--open) * -104deg)); }
.gate__door--right { right: 0; transform-origin: right center; transform: rotateY(calc(var(--open) * 104deg)); }
.gate__door::after { /* резная золотая кромка по шву */
  content: ''; position: absolute; top: 0; bottom: 0; width: 26px;
  background: var(--orn-gold) center top / 26px 13px repeat-y, linear-gradient(90deg, #2a1506, #4a2a0c 50%, #2a1506);
  box-shadow: 0 0 0 1px var(--brass-dark);
}
.gate__door--left::after { right: 0; }
.gate__door--right::after { left: 0; }
.gate__panel {
  position: relative;
  border: 2px solid var(--brass-dark);
  box-shadow:
    inset 0 0 0 6px rgba(0, 0, 0, .3), inset 0 0 0 7px rgba(201, 162, 86, .65),
    inset 0 0 0 18px rgba(0, 0, 0, .16), inset 0 0 0 19px rgba(201, 162, 86, .35),
    0 0 0 6px rgba(0, 0, 0, .25), 0 14px 30px rgba(0, 0, 0, .45);
  background: radial-gradient(ellipse at 50% 40%, rgba(255, 214, 140, .1), transparent 70%);
}
.gate__panel--top::after { /* розетка-медальон */
  content: ''; position: absolute; left: 50%; top: 50%; width: min(70%, 260px); aspect-ratio: 1; translate: -50% -50%;
  background: var(--ring) center / contain no-repeat; opacity: .9;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .6));
}
.gate__panel--low::after {
  content: ''; position: absolute; left: 14%; right: 14%; top: 50%; height: 24px; translate: 0 -50%;
  background: var(--orn-gold) center / 48px 24px repeat-x; opacity: .9;
}
.gate__handle {
  position: absolute; top: 52%; z-index: 2; width: 16px; height: clamp(90px, 16vh, 150px); translate: 0 -50%;
  border-radius: 10px; background: linear-gradient(90deg, #fff3c8, var(--brass) 40%, var(--brass-dark) 85%);
  box-shadow: 0 10px 16px rgba(0, 0, 0, .6), 0 0 0 4px rgba(18, 8, 2, .55), 0 0 0 5px var(--brass-dark);
}
.gate__door--left .gate__handle { right: 46px; }
.gate__door--right .gate__handle { left: 46px; }
.gate__glow { /* полоска света из щели */
  position: absolute; left: 50%; top: 0; bottom: 0; z-index: 6; width: 3px; translate: -50% 0;
  background: linear-gradient(transparent, #ffe9b0 18%, #fff7dc 50%, #ffe9b0 82%, transparent);
  box-shadow: 0 0 30px 10px rgba(255, 214, 140, .55), 0 0 110px 40px rgba(255, 214, 140, .22);
  opacity: clamp(0, calc(1 - var(--p, 0) * 3), 1);
  animation: crack 2.8s ease-in-out infinite alternate;
}
@keyframes crack { from { filter: brightness(.75); } to { filter: brightness(1.15); } }
.gate__plaque {
  position: absolute; left: 50%; top: 46%; z-index: 7; translate: -50% -50%;
  display: grid; justify-items: center; gap: .5rem; width: min(92vw, 34rem);
  padding: 2rem 1.6rem 1.8rem; text-align: center;
  background: radial-gradient(ellipse at center, rgba(18, 6, 2, .92), rgba(30, 10, 4, .85));
  border: 1px solid var(--brass); outline: 1px solid var(--brass-dark); outline-offset: 5px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, .6), 0 0 60px rgba(226, 196, 131, .18);
  opacity: clamp(0, calc(1 - var(--p, 0) * 4), 1);
  scale: calc(1 + var(--p, 0) * .3);
  animation: plaque-in 1.4s var(--ease-out) .2s both;
}
@keyframes plaque-in { from { opacity: 0; translate: -50% -40%; } }
.gate__plaque-eyebrow { font: .85rem var(--font-title); letter-spacing: .32em; text-transform: uppercase; color: var(--brass); }
.gate__plaque-title { font: clamp(2.4rem, 7vw, 4.2rem)/1 var(--font-display); }
.gate__plaque-sub { font: italic 1.1rem var(--font-text); color: var(--parchment); opacity: .85; }
.gate__cue {
  /* до прокрутки над шкафом ещё шапка (~6 rem), поэтому кнопка поднята на её высоту */
  display: none; position: absolute; left: 50%; bottom: calc(clamp(1.6rem, 5vh, 3rem) + 6.5rem); z-index: 8; translate: -50% 0;
  white-space: nowrap;
  flex-direction: column; align-items: center; gap: .6rem;
  min-height: 44px; padding: .8rem 1.6rem;
  font: 1rem var(--font-title); letter-spacing: .26em; text-transform: uppercase; color: var(--gold-light);
  background: rgba(18, 6, 2, .7); border: 1px solid var(--brass); cursor: pointer;
  opacity: clamp(0, calc(1 - var(--p, 0) * 6), 1);
  transition: background-color .3s;
}
.js .gate__cue { display: flex; }
.gate.is-moving .gate__cue { visibility: hidden; }
.gate__cue:hover { background: rgba(74, 13, 15, .85); }
.gate__cue-arrow { width: 14px; height: 14px; border-right: 2px solid var(--gold); border-bottom: 2px solid var(--gold); rotate: 45deg; animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { translate: 0 6px; } }

@media (max-width: 860px) {
  .gate__inside { grid-template-columns: 1fr; justify-items: center; text-align: center; padding-top: clamp(5rem, 11vh, 7rem); }
  .gate__kiot { position: absolute; left: 50%; top: 50%; translate: -50% -46%; width: min(78vw, 22rem); opacity: .38; }
  .js .gate__kiot { translate: -50% calc(-46% + (1 - var(--p, 0)) * 60px); }
  .gate__text { max-width: 30rem; }
  .gate__title span { margin-inline: auto; }
  .gate .divider { margin-inline: auto; }
  .gate__lead { margin-inline: auto; font-size: 1.05rem; }
  .gate__actions { justify-content: center; }
  .gate__door { padding: 6.5rem 1rem 2rem; }
  .gate__door::after { width: 16px; background-size: 16px 8px, auto; }
  .gate__handle { width: 11px; }
  .gate__door--left .gate__handle { right: 26px; }
  .gate__door--right .gate__handle { left: 26px; }
  .gate__plaque { padding: 1.5rem 1rem 1.4rem; }
}
@media (max-width: 760px) {
  .js .gate { height: 200vh; }
  .showcase__info { min-height: 6.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  .js .gate { height: 100vh; height: 100svh; }
  .js .gate__doors, .js .gate__cue { display: none; }
  .gate__title span, .gate__plaque-title, .gate__kiot::before, .gate__slide.is-active, .gate__glow { animation: none; }
}

/* ═══ «Анатомия образа»: сборка по прокрутке (навык scroll-assembly). Сначала телефон. ═══
   Шаги приходят из main.js переменными 0…1 на .asm__stage: --g свитшот из орла, --e блик на орле, --c лавры, --s в рубашку,
   --d доломан, --f финал. Без класса is-live (нет JS / «меньше движения») — статичный список глав. */

/* первый экран после створок — только заголовок и приглашение листать (кнопки — в финале сцены) */
.gate__inside { grid-template-columns: 1fr; justify-items: center; text-align: center; }
.gate__text { max-width: 44rem; }
.gate__title span { margin-inline: auto; }
.gate .divider { margin-inline: auto; }
.gate__next {
  margin-top: 1.6rem; font: .9rem var(--font-title); letter-spacing: .3em; text-transform: uppercase; color: var(--gold-text);
}
.gate__next::after { /* стрелка вниз */
  content: ''; display: block; width: 12px; height: 12px; margin: .9rem auto 0; rotate: 45deg;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; animation: bob 1.8s ease-in-out infinite;
}

.asm { position: relative; padding: clamp(3rem, 8vw, 5rem) 1rem; background: var(--night, #110d0a); color: var(--ink); }
.asm__glow {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 60% 42% at 50% 40%, rgba(255, 214, 150, .1), transparent 72%);
}
.asm__figure { position: relative; height: min(110vw, 460px); max-width: 100%; aspect-ratio: .933; margin: 0 auto; }
.asm__item { position: absolute; top: 0; left: 50%; height: 100%; translate: -50% 0; }
.asm__item--sweat { aspect-ratio: .933; perspective: 1100px; }
.asm__item--shirt { aspect-ratio: .801; perspective: 1100px; }
.asm__part, .asm__stitch, .asm__piece, .asm__grow, .asm__shirt, .asm__fx { position: absolute; inset: 0; width: 100%; height: 100%; }
/* тень — на уровень выше маски: у слоя с маской Safari обрезает тень по рамке картинки (виден тёмный прямоугольник) */
.asm__item--sweat, .asm__coat { filter: drop-shadow(0 22px 26px rgba(0, 0, 0, .5)); }
/* орёл — вырезка ×3 (tools/assembly-eagle.swift), стоит на месте вышивки в кадре свитшота; блик — поверх него */
.asm__eagle, .asm__sheen { position: absolute; left: 40.3%; top: 16.6%; width: 19.721%; height: 22.4%; }
.asm__sheen { pointer-events: none; mix-blend-mode: screen; mask-size: 100% 100%; -webkit-mask-size: 100% 100%; }
.asm__fx { pointer-events: none; mix-blend-mode: screen; mask-size: 100% 100%; -webkit-mask-size: 100% 100%; }

/* доломан «надет»: у картинки стёрта изнанка (подкладка в вырезе пол и внутри ворота) — сквозь неё видна рубашка.
   Рост доломана — 90 % рубашки, верх вровень: ворот рубашки встаёт в стойку, из-под пол видны перед и подол,
   из рукавов — край манжет. Надевается целиком, застёгнутым (владелец: «распахнутый не нужен») */
.asm__coat { position: absolute; top: -.2%; left: 50%; height: 90%; aspect-ratio: .806; translate: -50% 0; transform-origin: 50% 0; }

/* лавры на манжетах проступают вдоль манжеты, с мягким краем (маску ставит main.js) */
.asm__stitch--cuff-l { clip-path: inset(81% 70% 9% 1%); }
.asm__stitch--cuff-r { clip-path: inset(81% 1% 8% 70%); }

/* без JS: показан готовый свитшот, рубашка и доломан скрыты; главы — списком */
.asm:not(.is-live) .asm__item--shirt { display: none; }
.asm__chapters { display: grid; gap: 1.6rem; max-width: 30rem; margin: 2rem auto 0; text-align: center; }
.asm__num { font: .8rem var(--font-title); letter-spacing: .3em; text-transform: uppercase; color: var(--gold-text); }
.asm__title { margin-top: .35rem; font: 400 clamp(1.6rem, 6.4vw, 2.4rem)/1.15 var(--font-title); color: var(--ink); text-wrap: balance; }
.asm__chapter--intro .asm__title, .asm__chapter--final .asm__title { font-family: var(--font-display); color: var(--crimson); }
.asm__text { margin: .5rem auto 0; max-width: 24rem; font-size: 1.02rem; line-height: 1.5; color: var(--ink-soft); }
.asm__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .8rem; margin-top: 1.2rem; }

/* ——— живая сцена: экран закреплён, дорожка прокрутки ~7 экранов ——— */
.asm.is-live { height: calc(640svh + var(--lead, 0px)); padding: 0; }
/* ворота поверх начала сцены: за распахнутыми створками сразу «Анатомия образа» (первого экрана за дверями нет) */
.js .gate { position: relative; z-index: 3; background: transparent; }
.js .gate__sticky { background: transparent; }
.js .gate__inside { display: none; }
.js .asm { z-index: 1; }
.asm.is-live .asm__stage {
  position: sticky; top: 0; height: 100svh; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 4.6rem 1rem calc(.8rem + env(safe-area-inset-bottom));
}
.asm.is-live .asm__figure {
  flex: none; height: min(48svh, 96vw); margin-top: -1rem;
  transform: translateY(calc(var(--f, 0) * -4%)) scale(calc(1 - var(--f, 0) * .1));
}
/* Градиентные маски и фоны, зависящие от шага, ставит main.js готовой строкой: Safari не перерисовывает
   mask-image с var() при смене переменной (свитшот был виден целиком с самого начала).
   1. Орёл один в темноте, крупно, медленно поворачивается (--sway). Из него вырастает свитшот: ткань расходится
   кругом от орла с мягким краем, по краю бежит светлая «нить», всё уменьшается до места, орёл садится на грудь.
   --g 0…1. Центр орла в кадре свитшота — 50 % × 27,75 % */
@property --sway { syntax: '<angle>'; inherits: true; initial-value: 0deg; }
@keyframes asm-sway { from { --sway: -18deg; } to { --sway: 18deg; } }
.asm.is-live .asm__grow {
  transform-origin: 50% 27.75%;
  transform: translateY(calc((1 - var(--g, 1)) * 18%)) rotateY(calc(var(--sway) * (1 - var(--g, 1)))) rotateX(calc((1 - var(--g, 1)) * 8deg)) scale(calc(1 + (1 - var(--g, 1)) * .65));
  animation: asm-sway 3.6s ease-in-out infinite alternate;
}
.asm.is-live .asm__stage.is-grown .asm__grow { animation: none; }
.asm.is-live .asm__eagle { filter: drop-shadow(0 0 calc((1 - var(--g, 1)) * 14px) rgba(214, 60, 60, .45)); }
.asm.is-live .asm__thread {
  opacity: clamp(0, min(var(--g, 1) * 8, (1 - var(--g, 1)) * 8), 1);
  mask-image: url(../images/assembly/sweatshirt-plain.avif); -webkit-mask-image: url(../images/assembly/sweatshirt-plain.avif);
}
/* 2. Орёл — блик пробегает по вышивке (--e) */
.asm.is-live .asm__sheen {
  opacity: clamp(0, min(var(--e, 0) * 8, (1 - var(--e, 0)) * 8), 1);
  mask-image: url(../images/assembly/eagle.avif); -webkit-mask-image: url(../images/assembly/eagle.avif);
}
/* 3. Свитшот перекраивается в рубашку: светлый шов идёт сверху вниз, выше него уже рубашка, ниже — ещё свитшот;
   вся вещь чуть поворачивается (--s) */
.asm.is-live .asm__figure { perspective: 1400px; }
.asm.is-live .asm__item--sweat {
  transform: rotateY(calc(sin(var(--s, 0) * 180deg) * -14deg));
}
.asm.is-live .asm__shirt {
  transform: rotateY(calc(sin(var(--s, 0) * 180deg) * -14deg));
}
.asm.is-live .asm__seam {
  opacity: clamp(0, min(var(--s, 0) * 10, (1 - var(--s, 0)) * 10), 1);
  mask-image: url(../images/assembly/shirt.avif); -webkit-mask-image: url(../images/assembly/shirt.avif);
  transform: rotateY(calc(sin(var(--s, 0) * 180deg) * -14deg));
}
/* 4. Доломан опускается на плечи целиком, застёгнутым, с лёгким наклоном и садится; рубашку сменяет копия без плеч
   и боков (они уже под доломаном), чтобы ничего белого не выглядывало по краям */
.asm.is-live .asm__coat {
  opacity: clamp(0, calc(var(--d, 0) * 5), 1);
  transform: translateY(calc((1 - var(--d, 0)) * -34%)) rotateX(calc((1 - var(--d, 0)) * 24deg)) scale(calc(1 + (1 - var(--d, 0)) * .14));
  filter: drop-shadow(0 calc(4px + var(--d, 0) * 8px) calc(8px + var(--d, 0) * 10px) rgba(0, 0, 0, .45));
}
.asm.is-live .asm__worn { opacity: clamp(0, calc((var(--s, 0) - .97) * 40), 1); }
.asm.is-live .asm__shirt > img { opacity: calc(1 - clamp(0, (var(--d, 0) - .72) * 6, 1)); }
/* видео главной (js/scrollfilm.js): кадр на всю сцену, подписи поверх; сборка из картинок скрыта */
.asm__film { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; background: var(--night, #110d0a); pointer-events: none; }
.asm__shade {
  position: absolute; inset: auto 0 0; height: 50%; z-index: 1; pointer-events: none;
  background: linear-gradient(to top, color-mix(in srgb, var(--night, #110d0a) 96%, transparent) 25%, color-mix(in srgb, var(--night, #110d0a) 60%, transparent) 60%, transparent);
}
/* подсветка поверх ролика («экраном», тёплая): контровой ореол за фигурой, столб света сверху, тёплые края кадра */

.asm__light { /* подвижный свет (как в референсе): фон-градиенты ставит scrollfilm.js по ходу ролика */
  position: absolute; inset: 0; z-index: 0; pointer-events: none; mix-blend-mode: screen;
  -webkit-mask-image: linear-gradient(#000 0, #000 60%, transparent 95%); mask-image: linear-gradient(#000 0, #000 60%, transparent 95%);
}
/* стрелка «листайте вниз» под первой подписью: золотой шеврон, мягко покачивается */
.asm__cue {
  display: block; position: relative; width: 14px; height: 14px; margin: 1.1rem auto 0; rotate: 45deg;
  border-right: 1.5px solid var(--gold-light); border-bottom: 1.5px solid var(--gold-light);
  animation: bob 1.8s ease-in-out infinite;
}
.asm__cue::after { /* вторая стрелка ниже, бледнее — «ёлочка» читается как направление */
  content: ''; position: absolute; left: 5px; top: 5px; width: 14px; height: 14px; opacity: .45;
  border-right: 1.5px solid var(--gold-light); border-bottom: 1.5px solid var(--gold-light);
}
@media (prefers-reduced-motion: reduce) { .asm__cue { animation: none; } }
@media (min-width: 900px) { .asm.is-live .asm__chapter--intro .asm__cue { margin-left: 4px; } } /* на компьютере подпись слева */
.asm--film .asm__figure, .asm--film .asm__glow { display: none; }
.asm.is-live.asm--film .asm__stage { justify-content: flex-end; padding-bottom: calc(2.2rem + env(safe-area-inset-bottom)); }
@media (min-width: 900px) { .asm--film .asm__film { object-fit: contain; } } /* на компьютере вертикальный кадр — по центру, без обрезки */

/* 3D-сборка (js/assembly3d.js): холст на всю сцену; пока идёт шаг, DOM-вещи этого шага скрыты */
.asm__gl { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; }
.asm__stage[data-gl="shirt"] .asm__item--sweat, .asm__stage[data-gl="shirt"] .asm__shirt,
.asm__stage[data-gl="shirt"] .asm__seam, .asm__stage[data-gl="shirt"] .asm__worn,
.asm__stage[data-gl="coat"] .asm__shirt, .asm__stage[data-gl="coat"] .asm__worn,
.asm__stage[data-gl="coat"] .asm__coat { visibility: hidden; }
.asm.is-live .asm__chapters { position: relative; z-index: 2; display: block; width: 100%; height: 10.5rem; margin: 1.4rem 0 0; }
.asm.is-live .asm__chapter { /* уходящая подпись гаснет быстро, новая проявляется следом — не накладываются */
  position: absolute; inset: 0; opacity: 0; translate: 0 14px; pointer-events: none;
  transition: opacity .22s, translate .22s;
}
.asm.is-live .asm__chapter.is-on {
  opacity: 1; translate: 0 0; pointer-events: auto;
  transition: opacity .5s .22s, translate .6s .22s var(--ease-out);
}

@media (min-width: 900px) {
  .asm.is-live .asm__figure { height: 64svh; }
  .asm.is-live .asm__chapters { position: absolute; inset: 0; width: auto; max-width: none; height: auto; margin: 0; }
  .asm.is-live .asm__chapter { inset: 50% auto auto 5vw; width: min(25vw, 22rem); translate: 0 calc(-50% + 14px); text-align: left; }
  .asm.is-live .asm__chapter.is-on { translate: 0 -50%; }
  .asm.is-live .asm__chapter:nth-child(odd) { inset: 50% 5vw auto auto; text-align: right; }
  .asm.is-live .asm__chapter .asm__text { margin-inline: 0; }
  .asm.is-live .asm__chapter:nth-child(odd) .asm__text { margin-left: auto; }
  /* вступление и финал — слева от фигуры (ниже фигуры на компьютере места нет) */
  .asm.is-live .asm__chapter.asm__chapter--intro, .asm.is-live .asm__chapter.asm__chapter--final {
    inset: 50% auto auto 5vw; width: min(25vw, 22rem); text-align: left;
  }
  .asm.is-live .asm__chapter.asm__chapter--intro .asm__text, .asm.is-live .asm__chapter.asm__chapter--final .asm__text { margin-inline: 0; }
  .asm.is-live .asm__chapter--final .asm__actions { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) { .gate__next::after { animation: none; } }

/* ——— вещь крупно (окно вещи с cutout): снята с вешалки, стоит перед нами, вертится пальцем; справа размеры ——— */
.modal.modal--viewer { width: min(1120px, calc(100vw - 1rem)); }
.modal.modal--viewer[open] { animation: viewer-box .55s ease-out both; } /* рамка и фон проявляются, вещь уже летит */
@keyframes viewer-box { from { background-color: transparent; border-color: transparent; outline-color: transparent; } }
.modal--viewer[open]::backdrop { animation: viewer-dim .5s ease-out both; }
@keyframes viewer-dim { from { opacity: 0; } }
.modal--viewer .modal__info, .modal--viewer .modal__close, .modal--viewer .viewer__hint { animation: viewer-text .5s .45s both; }
@keyframes viewer-text { from { opacity: 0; transform: translateY(10px); } }
.modal--viewer .modal__body { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: center; }
.viewer { --vh: min(72vh, 640px); position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .7rem; align-items: center; }
.viewer__hint { grid-column: 1 / -1; }
/* миниатюры справа от вещи: сама вещь и настоящие фото — выбранное встаёт на место вещи */
.viewer__thumbs { display: flex; flex-direction: column; gap: .5rem; max-height: var(--vh); overflow-y: auto; scrollbar-width: none; }
.viewer__thumbs:empty { display: none; }
.viewer__thumb {
  flex: none; width: 3.4rem; aspect-ratio: 3 / 4; padding: 0; overflow: hidden; cursor: pointer;
  background: #0e0d0c; border: 1px solid var(--line-strong); opacity: .6; transition: opacity .25s, border-color .25s;
}
.viewer__thumb img { width: 100%; height: 100%; object-fit: cover; }
.viewer__thumb:first-child img { object-fit: contain; padding: 4px; } /* сама вещь — целиком */
.viewer__thumb[aria-pressed="true"] { opacity: 1; border-color: var(--crimson); }
.viewer__photo { /* настоящее фото на месте вещи */
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none;
  opacity: 0; transition: opacity .35s ease;
}
.viewer__stage .viewer__lift { transition: opacity .35s ease; }
.viewer__stage.is-photo .viewer__photo { opacity: 1; }
.viewer__stage.is-photo .viewer__lift { opacity: 0; }
.viewer__stage {
  position: relative; display: grid; place-items: center; height: var(--vh);
  perspective: 1100px; touch-action: pan-y; user-select: none; -webkit-user-select: none;
  background: radial-gradient(ellipse 58% 52% at 50% 44%, rgba(255, 232, 192, .1), transparent 72%); /* мягкий свет за вещью */
}
.viewer__stage.is-turnable { cursor: grab; }
.viewer__stage.is-turnable:active { cursor: grabbing; }
.viewer__lift { position: relative; width: min(100%, calc(var(--vh) * .86 / var(--ar))); aspect-ratio: 1 / var(--ar); will-change: transform; }
.spin { position: absolute; inset: 0; }
.spin__face {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: 50% 0;
  filter: drop-shadow(0 26px 24px rgba(0, 0, 0, .55)); -webkit-touch-callout: none; pointer-events: none;
}
.spin__face--back { opacity: 0; } /* стороны меняются растворением (JS), не настоящим поворотом — вещь плоская, бок не показываем */
.viewer__floor { /* тень на полу под вещью */
  position: absolute; left: 14%; right: 14%; bottom: -5%; height: 6%; border-radius: 50%; z-index: -1;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .55), transparent);
}
.viewer__hint:empty { display: none; }
.viewer__hint { margin: .4rem 0 0; text-align: center; font-size: .85rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
/* вещь, снятая со штанги, пропадает с вешалки, пока открыто окно; потом плавно возвращается */
.flip .garment__photo { transition: opacity .5s ease; }
.flip .garment__photo.is-lifted { opacity: 0; transition: opacity .15s; }
@media (max-width: 760px) { /* телефон: вещь сверху крупно, размеры и заказ — ниже, листаются */
  .modal.modal--viewer { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; padding: 1rem 1rem 2rem; }
  .modal--viewer .modal__body { grid-template-columns: 1fr; gap: 1rem; }
  .viewer { --vh: 54svh; }
  .viewer__thumb { width: 2.9rem; }
}
@media (prefers-reduced-motion: reduce) {
  .modal--viewer[open], .modal--viewer[open]::backdrop, .modal--viewer .modal__info, .modal--viewer .modal__close, .modal--viewer .viewer__hint { animation: none; }
}
