.type-hero {
  padding-block: clamp(35px, 5.2vw, 76px) clamp(30px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.type-stage {
  --title-pad: max(22px, 3.1cqw);
  --word-size: 12.5cqw;
  --second-word-size: 17.5cqw;
  --word-leading: .89;
  --row-gap: 4.4cqw;
  --second-row: calc(var(--title-pad) + var(--word-size) * var(--word-leading) + var(--row-gap));
  position: relative;
  container-type: inline-size;
  isolation: isolate;
}

.type-hero h1 {
  position: relative;
  z-index: 2;
  margin: 0;
  padding-block: var(--title-pad);
  color: var(--red);
  font-family: Jost, Arial, sans-serif;
  font-weight: 900;
  letter-spacing: -.065em;
  line-height: var(--word-leading);
  pointer-events: none;
}

.type-word {
  position: relative;
  left: 50%;
  display: block;
  width: max-content;
  padding-inline-end: .065em;
  font-size: var(--word-size);
  transform: translateX(-50%) scaleX(var(--word-scale, 1));
}

.type-word + .type-word {
  margin-top: var(--row-gap);
  font-size: var(--second-word-size);
}

.type-work {
  position: absolute;
  z-index: 1;
  top: calc(var(--row, var(--title-pad)) + var(--y));
  left: var(--x);
  display: block;
  width: max(44px, var(--window-width));
  height: max(44px, var(--window-height));
  transform: translate(-50%, -50%);
  -webkit-tap-highlight-color: transparent;
}

.type-work img {
  position: absolute;
  inset: 50% auto auto 50%;
  display: block;
  width: var(--window-width);
  height: var(--window-height);
  object-fit: cover;
  object-position: var(--crop, center);
  border: 1px solid #21191c24;
  border-radius: 2px;
  box-shadow: 0 3px 8px #21191c23;
  transform: translate(-50%, -50%) rotate(var(--angle));
  transition: transform .22s ease, filter .22s ease;
}

.type-work.is-displaced {
  opacity: 0;
}

.type-work:focus-visible {
  outline: 2px solid #19191c;
  outline-offset: 5px;
}

.type-work:focus-visible img {
  filter: brightness(1.3);
}

@media (hover: hover) and (pointer: fine) {
  .type-work:hover img {
    transform: translate(-50%, -54%) rotate(calc(var(--angle) + 3deg));
    filter: brightness(1.08);
  }
}

.type-work--jewelry {
  --x: 14.5%; --y: 1.4cqw;
  --window-width: 5.5cqw; --window-height: 6.1cqw; --crop: 52% 63%;
  --angle: 13deg;
}

.type-work--poster {
  --x: 79.8%; --y: 5.8cqw;
  --window-width: 5.6cqw; --window-height: 5.8cqw; --crop: 60% 54%;
  --angle: 19deg;
}

.type-work--print {
  --row: var(--second-row);
  --x: 14%; --y: 6.8cqw;
  --window-width: 5.1cqw; --window-height: 6.3cqw; --crop: 50% 42%;
  --angle: 8deg;
}

.type-work--souvenir {
  --row: var(--second-row);
  --x: 53.6%; --y: 4.2cqw;
  --window-width: 6.2cqw; --window-height: 5.4cqw; --crop: 57% 63%;
  --angle: -24deg;
}

.type-hero .button {
  margin-top: clamp(20px, 2.1vw, 33px);
}

.type-preview {
  --preview-height: min(64dvh, calc(100dvh - 152px), 620px);
  width: min(480px, calc(100% - 32px), max(260px, calc(var(--preview-height) * var(--preview-ratio, .8) + 24px)));
  max-height: calc(100% - 32px);
  margin: auto;
  padding: 12px;
  overflow: auto;
  border: 0;
  border-radius: 9px;
  background: #fff;
  color: #19191c;
  box-shadow: 0 18px 80px #20151a44;
}

.type-preview::backdrop {
  background: #1b141bcc;
}

.type-preview img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: var(--preview-height);
  margin-inline: auto;
  border-radius: 4px;
}

.type-preview-close {
  display: block;
  min-height: 44px;
  margin: 0 0 6px auto;
  padding-inline: 9px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.type-preview-close:hover {
  background: #f7f2f3;
}

.type-preview-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 16px;
  padding: 12px 4px 4px;
}

.type-preview-caption h2 {
  font-family: inherit;
  font-size: 1.3rem;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -.025em;
}

@media (max-width: 700px) {
  .type-stage {
    --word-size: 12.95cqw;
    --second-word-size: 21.15cqw;
    --row-gap: 5cqw;
  }

  .type-work--poster { --y: 6cqw; }
  .type-work--print { --y: 8.2cqw; }
  .type-work--souvenir { --y: 5cqw; }
}

@media (prefers-reduced-motion: reduce) {
  .type-work img,
  .type-preview,
  .type-preview-close,
  .type-preview-caption { transition: none; }
  .type-work:hover img {
    transform: translate(-50%, -50%) rotate(var(--angle));
  }
}
