/* Этек. Направление «Цветная стена»: охра, марена, сажа. Unbounded для слова и заголовков, Manrope для текста.
   Отступы кратны 8, радиус один: 999 у кнопок. Кадр лежит «сценой»: обложкой на весь экран, а слово и фигура
   ставятся в долях этого кадра (img/cut.css), поэтому голова всегда закрывает одни и те же буквы. */
:root {
  --soot: #1b1a17;
  --soot-2: #3a362e;
  --paper: #f3eee4;
  --madder: #8c2a22;
  --madder-700: #6f1f19;
  --wall: #d9a63d;
  --floor: #cd9c35;
  --ink: #c98f3c;      /* краска букв на стене, ложится умножением */
  --pad: 48px;
}
* { box-sizing: border-box; }
html {
  background: var(--floor);
  color: var(--soot);
  scrollbar-color: var(--soot-2) var(--floor);
  scrollbar-width: thin;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body { margin: 0; font: 500 16px/1.5 Manrope, system-ui, sans-serif; overflow-x: clip; }
a { color: inherit; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--soot); outline-offset: 3px; border-radius: 4px; }

/* шапка */
.top {
  position: absolute; z-index: 10; inset: 0 0 auto;
  display: flex; align-items: center; gap: 24px;
  padding: 24px var(--pad);
}
.mark { font: 800 20px/1 Unbounded, sans-serif; letter-spacing: .02em; text-decoration: none; }
.concept { font-size: 13px; font-weight: 600; color: var(--soot-2); }
.nav { display: flex; gap: 32px; margin-left: auto; }
.nav a, .tools a, .lang { font: 600 15px/1 Manrope, sans-serif; text-decoration: none; }
.nav a:hover, .tools a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1.5px; }
.tools { display: flex; align-items: center; gap: 24px; margin-left: 40px; }
.lang { appearance: none; border: 0; background: none; color: inherit; padding: 8px 0; cursor: pointer; }
.lang:hover { text-decoration: underline; text-underline-offset: 4px; }
.bag { display: inline-flex; align-items: center; gap: 8px; }
.bag-n {
  display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px;
  border-radius: 999px; background: var(--soot); color: var(--paper); font: 700 12px/1 Manrope, sans-serif;
}

/* сцена: кадр обложкой, фигура и буквы в долях кадра */
.hero { position: relative; }
.stage { position: relative; overflow: hidden; container-type: size; isolation: isolate; }
.stage, .hero {
  --sw: max(100cqw, 100cqh * var(--ar));
  --sh: calc(var(--sw) / var(--ar));
  --sx: calc((100cqw - var(--sw)) * var(--fx));
  --sy: calc((100cqh - var(--sh)) * var(--fy));
}
.wall, .lines, .figure { position: absolute; margin: 0; }
.wall, .lines { left: var(--sx); top: var(--sy); width: var(--sw); height: var(--sh); }
.wall img, .figure img { display: block; width: 100%; height: 100%; }
.figure {
  z-index: 2;
  left: calc(var(--sx) + var(--sw) * var(--cx));
  top: calc(var(--sy) + var(--sh) * var(--cy));
  width: calc(var(--sw) * var(--cw));
  height: calc(var(--sh) * var(--ch));
}
/* слово написано на стене: умножение берёт свет, складки полотна и тень фигуры */
.word {
  position: absolute; z-index: 1; left: 50%; translate: -50% 0;
  top: calc(var(--sy) + var(--sh) * var(--wy));
  /* ширина по замеру шрифта, но не ниже низа жакета: под ним фигура не вырезана */
  font: 900 min(calc(var(--wordw) / var(--k)), calc(var(--sh) * .5), var(--word-cap, 9999px)) / .74 Unbounded, sans-serif;
  letter-spacing: -.035em;
  white-space: nowrap;
  color: var(--ink);
  mix-blend-mode: multiply;
  user-select: none;
}
html[lang="en"] .word { --k: var(--k-en); }
.lines { z-index: 3; pointer-events: none; overflow: visible; }
.lines path { fill: none; stroke: var(--soot); stroke-width: 1.25px; vector-effect: non-scaling-stroke; }
.lines circle { fill: var(--soot); }

/* загрузка: стёжка ромбом рисуется, если кадр грузится дольше 0,3 с */
.loader { position: absolute; inset: 0; z-index: 6; display: none; place-items: center; background: var(--wall); }
.loader svg { width: 72px; height: 72px; }
.loader path { fill: none; stroke: var(--madder); stroke-width: 2.5; stroke-dasharray: 1; stroke-dashoffset: 1; animation: stitch 1.6s ease-in-out infinite; }
@keyframes stitch { 50% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -1; } }
.slow .loader { display: grid; }

/* появление: кадр целиком, потом слово поднимается из-за плеч */
.js .stage > .wall, .js .stage > .figure, .js .stage > .lines { opacity: 0; }
.js .word { opacity: 0; translate: -50% 6%; }
.js .tag, .js .copy > * { opacity: 0; }
.ready .stage > .wall, .ready .stage > .figure { opacity: 1; transition: opacity .5s ease-out; }
.ready .word { opacity: 1; translate: -50% 0; transition: opacity .7s ease-out .2s, translate 1.1s cubic-bezier(.2, .7, .2, 1) .2s; }
.ready .stage > .lines, .ready .tag { opacity: 1; transition: opacity .5s ease-out .7s; }
.ready .copy > * { opacity: 1; transition: opacity .6s ease-out .35s; }
.failed .stage > *, .failed .tag { opacity: 0 !important; }
@media (prefers-reduced-motion: reduce) { .ready * { transition-duration: 0s !important; transition-delay: 0s !important; } .loader path { animation: none; stroke-dashoffset: 0; } }

/* подпись вещи, связанная линией с жакетом */
.tag { display: grid; gap: 2px; text-decoration: none; }
.tag-name { font-weight: 700; }
.tag-note { font-size: 13px; color: var(--soot-2); }
.tag-price { font: 700 20px/1.2 Unbounded, sans-serif; margin-top: 8px; letter-spacing: -.01em; }
.tag-sizes { font-size: 13px; font-weight: 700; letter-spacing: .06em; word-spacing: .2em; }
.tag-sizes s { opacity: .45; }
.tag:hover .tag-name { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1.5px; }

/* текст и кнопки */
.hero h1 { margin: 0; font: 700 clamp(24px, 2.75cqw, 44px)/1.12 Unbounded, sans-serif; letter-spacing: -.03em; text-wrap: balance; }
.hero .lead { font-size: 17px; line-height: 1.5; max-width: 44ch; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 24px 1px;
  border-radius: 999px; border: 1.5px solid var(--soot); background: var(--soot); color: var(--paper);
  font: 700 15px/1 Manrope, sans-serif; text-decoration: none; cursor: pointer;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .14);
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--madder); border-color: var(--madder); }
.btn:active { translate: 0 1px; }
.btn.ghost { background: transparent; color: var(--soot); box-shadow: none; }
.btn.ghost:hover { background: rgb(27 26 23 / .08); border-color: var(--soot); }
.season { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

.fail { position: absolute; inset: 0; z-index: 8; display: grid; place-content: center; justify-items: center; gap: 16px; padding: 24px; text-align: center; background: var(--wall); }
.fail[hidden] { display: none; }
.fail p { max-width: 34ch; font-weight: 600; }

/* компьютер: широкий кадр b6, текст слева внизу, подпись справа от жакета */
@media (min-width: 960px) and (min-aspect-ratio: 5/4) {
  .hero {
    height: 100svh; min-height: 600px; container-type: size; overflow: hidden;
    --ar: var(--wide-ar); --fx: .62; --fy: .35;
    --cx: var(--wide-cx); --cy: var(--wide-cy); --cw: var(--wide-cw); --ch: var(--wide-ch);
    --wordw: 94cqw; --k: 3.35; --k-en: 3.22; --wy: .2;
    /* буквы кончаются над текстом: высота текста с абзацем и без него, буквы на .75 кегля */
    --copy-h: 190px;
    --word-cap: calc((100cqh - var(--pad) - var(--copy-h) - 24px - var(--sy) - var(--sh) * var(--wy)) / .75);
  }
  .stage { position: absolute; inset: 0; }
  .tag { position: absolute; z-index: 4; left: calc(var(--sx) + var(--sw) * .762); top: calc(var(--sy) + var(--sh) * .605); }
  /* текст кончается до тени фигуры на стене (x 0.425 кадра), иначе сажа на тёмной тени не читается */
  .copy {
    position: absolute; z-index: 4; left: var(--pad); bottom: var(--pad);
    width: min(600px, calc(var(--sx) + var(--sw) * .425 - var(--pad) - 24px));
    display: flex; flex-direction: column; gap: 20px;
  }
  .hero h1 { font-size: clamp(24px, min(2.75cqw, 4.6cqh), 44px); }
  .hero .actions { margin-top: 8px; }
  .season { position: absolute; z-index: 4; right: var(--pad); bottom: var(--pad); }
}
/* ближе к квадрату (4:3, 5:4): слово уже и выше, чтобы не встретиться с заголовком */
@media (min-width: 960px) and (min-aspect-ratio: 5/4) and (max-aspect-ratio: 3/2) {
  .hero { --wordw: 82cqw; --wy: .16; }
}
/* вводный абзац только в высоком окне; в обычном окне ноутбука остаются заголовок и кнопки */
@media (min-width: 960px) and (min-aspect-ratio: 5/4) and (max-height: 819px) {
  .hero .lead { display: none; }
}
@media (min-width: 960px) and (min-aspect-ratio: 5/4) and (min-height: 820px) {
  .hero { --copy-h: 340px; }
}

/* телефон и узкие окна: высокий кадр b3 на весь экран, заголовок над словом, кнопки сразу под кадром */
@media not all and (min-width: 960px) and (min-aspect-ratio: 5/4) {
  :root { --pad: 20px; --floor: #d09319; }
  .top { padding: 16px var(--pad); gap: 12px; }
  .concept { font-size: 12px; }
  .nav { display: none; }
  .tools { margin-left: auto; gap: 16px; }
  .bag > span { display: none; }
  .hero {
    --ar: var(--tall-ar); --fx: .53; --fy: .45;
    --cx: var(--tall-cx); --cy: var(--tall-cy); --cw: var(--tall-cw); --ch: var(--tall-ch);
    --wordw: 92cqw; --k: 3.35; --k-en: 3.22; --wy: .195;
    --tall-h: max(560px, 100svh);
    display: flex; flex-direction: column;
  }
  .stage { height: var(--tall-h); }
  /* низ кадра переходит в цвет пола, на котором стоят кнопки */
  .stage::after { content: ""; position: absolute; inset: auto 0 0; height: 64px; z-index: 4; background: linear-gradient(rgb(208 147 25 / 0), var(--floor)); }
  .lines { display: none; }
  .tag { position: absolute; z-index: 5; left: var(--pad); top: calc(var(--tall-h) - 92px); }
  .tag-note, .tag-sizes { display: none; }
  .tag-price { font-size: 16px; margin-top: 2px; }
  .copy { display: contents; }
  .hero h1 { position: absolute; z-index: 5; top: 64px; left: var(--pad); right: var(--pad); font-size: clamp(20px, 6.2vw, 28px); }
  .hero .actions { order: 1; padding: 8px var(--pad) 0; }
  .hero .btn { flex: 1 1 auto; padding: 0 16px 1px; }
  .hero .lead { order: 2; padding: 32px var(--pad) 0; }
  .season { order: 3; padding: 24px var(--pad) 40px; color: var(--soot-2); }
}
@media not all and (min-width: 960px) and (min-aspect-ratio: 5/4) {
  @media (max-height: 700px) { .hero h1 { top: 56px; font-size: clamp(18px, 5.4vw, 22px); } }
}
