/* Own container and spacing: the card is placed by any page, not only inside
   the winter-experience canvas. Desktop keeps the Figma frame (5760:2263). */
.winter-letter-block {
  container: winter-letter / inline-size;
}
.winter-letter__backdrop { display: none; }
.winter-letter {
  --letter-unit: 1rem;
  position: relative;
  isolation: isolate;
  width: min(calc(100% - 2 * var(--page-gutter)), 72.5rem);
  margin-inline: auto;
  overflow: clip;
  border: 1px solid transparent;
  border-radius: 1.75rem;
  background: linear-gradient(62.6968deg, #2853d5 27.37%, #152b6f 94.968%);
  color: #fff;
}
.winter-letter::after {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: 2;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(180deg, rgb(255 255 255 / 37%), rgb(255 255 255 / 7.4%));
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
}
.winter-letter__content {
  position: relative;
  z-index: 1;
  padding: clamp(1.375rem, 4.5vw, 2rem);
}
.winter-letter__label {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 6.9375rem;
  min-height: 1.875rem;
  padding: .4rem .8rem;
  border-radius: 1.25rem;
  isolation: isolate;
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.11;
}
.winter-letter__label::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: #414f80;
  opacity: .75;
  backdrop-filter: blur(25px);
}
.winter-letter__title {
  margin-top: 1.125rem;
  max-width: 24rem;
  font-size: clamp(1.375rem, calc(1.1071rem + 1.3393vw), 1.75rem);
  font-weight: 600;
  line-height: 1.11;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}
.winter-letter__title-ending { display: block; }
.winter-letter__highlight-group { white-space: nowrap; }
.winter-letter__highlight {
  background: linear-gradient(75.4038deg, #f4d28d .75162%, #fcefc9 99.459%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}
.winter-letter__title-icon {
  display: inline-flex;
  align-items: center;
  width: calc(1.3125 * var(--letter-unit));
  height: calc(1.3125 * var(--letter-unit));
  margin-left: .35em;
  vertical-align: baseline;
}
.winter-letter__title-icon img,
.winter-letter__download-icon img { width: 100%; height: auto; max-width: none; }
.winter-letter__description {
  max-width: 22.5rem;
  margin-top: 1.125rem;
  opacity: .86;
  font-size: .875rem;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}
.winter-letter__download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .625rem;
  min-height: 3.75rem;
  width: min(100%, 14.5625rem);
  margin-top: 1.75rem;
  padding: 1rem;
  border-radius: var(--radius-pill);
  background: linear-gradient(84.47584deg, #f4d28d .75162%, #fcefc9 99.459%);
  color: #876b2b;
  font-size: .9375rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -.03em;
  text-align: center;
}
.winter-letter__download { cursor: pointer; transition: filter .2s, scale .2s; }
.winter-letter__download:hover { filter: brightness(1.045); }
.winter-letter__download:active { scale: .98; }
.winter-letter__download:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
.winter-letter__download-icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  width: calc(1.25 * var(--letter-unit));
  height: calc(.875 * var(--letter-unit));
}
.winter-letter__artwork {
  display: block;
  overflow: hidden;
  aspect-ratio: 1.3;
  margin-top: -.5rem;
}
.winter-letter__artwork img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
}
/* Phone/tablet, after kvestkids.ru/ded-moroz-v-ofis (.ny-letter): the Figma
   art is the card's surface. Its dark left edge, stretched by `cover`, fills the
   card behind the copy; the letter crop of the same file sits below (phone) or
   to the right (tablet) and fades into it, so there is no seam or flat strip.
   Font and control sizes follow the reference; colours and weights are ours. */
@container winter-letter (width < 75rem) {
  .winter-letter {
    display: grid;
    width: calc(100% - 2 * var(--compact-page-gutter));
    margin: 2.25rem auto 0;
    border-radius: 1.875rem;
    background: #10162f;
  }
  .winter-letter__backdrop {
    display: block;
    position: absolute;
    inset: 0;
    z-index: -1;
  }
  .winter-letter__backdrop img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: 0 50%;
  }
  .winter-letter__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.75rem 1.5rem 0;
    text-align: center;
  }
  .winter-letter__label {
    min-width: 6.9375rem;
    min-height: 2.5rem;
    padding: .5rem 1.25rem;
    font-size: 1rem;
    line-height: 1.5;
  }
  .winter-letter__title {
    max-width: 26rem;
    margin-top: 1.5rem;
    font-size: calc(1.75rem * var(--winter-fit-heading));
    line-height: 1.1;
    text-wrap: balance;
  }
  .winter-letter__description {
    max-width: 26.25rem;
    margin-top: 1.25rem;
    font-size: calc(1.125rem * var(--winter-fit-text));
    line-height: 1.2;
  }
  .winter-letter__download {
    width: min(100%, 15.5625rem);
    min-height: 3.75rem;
    margin-top: 1.5rem;
    font-size: 1rem;
  }
  .winter-letter__artwork {
    --letter-crop: 1 / 1;
    width: 100%;
    margin-top: .5rem;
    aspect-ratio: var(--letter-crop);
    mask-image: linear-gradient(transparent, #000 22%);
  }
  .winter-letter__artwork img { object-position: 88% 100%; }
}
/* Wider phones show more of the room around the letter. */
@container winter-letter (30rem <= width < 48rem) {
  .winter-letter__artwork { --letter-crop: 7 / 5; }
  .winter-letter__artwork img { object-position: 100% 100%; }
}
/* Tablet: copy on the left, the letter scene on the right melting into it. */
@container winter-letter (48rem <= width < 75rem) {
  .winter-letter {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
    min-height: 26.25rem;
    border-radius: 2rem;
  }
  .winter-letter__content {
    grid-area: 1 / 1;
    justify-content: center;
    align-items: flex-start;
    padding: 2.5rem 1.5rem 2.75rem 2rem;
    text-align: left;
  }
  .winter-letter__title { font-size: calc(2rem * var(--winter-fit-heading)); }
  .winter-letter__download { min-height: 4.25rem; margin-top: 1.75rem; }
  .winter-letter__artwork {
    grid-area: 1 / 2;
    width: auto;
    height: 100%;
    margin: 0 0 0 -4rem;
    aspect-ratio: auto;
    mask-image: linear-gradient(to right, transparent, #000 35%);
  }
  .winter-letter__artwork img { object-position: 90% 100%; }
}
/* Narrowest phones: "Скачайте шаблон" and its icon keep to one line, as in the
   reference; Golos at weight 600 needs the extra 8px of width. */
@container winter-letter (width < 22rem) {
  .winter-letter__content { padding-inline: 1.25rem; }
  .winter-letter__title-icon { margin-left: .25em; }
}
/* 200% text: reading width rather than enlarged page gutters. */
@container winter-letter (width < 20rem) {
  .winter-letter__content { padding-inline: 1.25rem; }
  .winter-letter__label { min-width: 0; max-width: 100%; padding-inline: .75rem; overflow-wrap: anywhere; }
  .winter-letter__highlight-group { white-space: normal; }
  .winter-letter__download > span:first-child { min-width: 0; overflow-wrap: anywhere; }
}
@container winter-letter (width >= 75rem) {
  .winter-letter {
    --letter-unit: var(--winter-canvas-unit);
    display: block;
    width: calc(72.5 * var(--letter-unit));
    max-width: calc(100% - 2.5rem);
    min-height: calc(24.75 * var(--letter-unit));
    border-radius: calc(2.5 * var(--letter-unit));
  }
  .winter-letter__content {
    padding: calc(3.3125 * var(--letter-unit)) calc(3.75 * var(--letter-unit)) calc(3.1875 * var(--letter-unit));
  }
  .winter-letter__label {
    min-width: calc(6.9375 * var(--letter-unit));
    min-height: calc(1.875 * var(--letter-unit));
    padding: 0;
    border-radius: calc(1.25 * var(--letter-unit));
    font-size: calc(.875 * var(--letter-unit));
  }
  .winter-letter__title {
    max-width: calc(38.625 * var(--letter-unit));
    margin-top: calc(1.1875 * var(--letter-unit));
    font-size: calc(1.875 * var(--letter-unit));
  }
  .winter-letter__title-icon {
    position: absolute;
    top: calc(6.9375 * var(--letter-unit));
    left: calc(20.5625 * var(--letter-unit));
    margin: 0;
  }
  .winter-letter__description {
    max-width: calc(22.5 * var(--letter-unit));
    margin-top: calc(1.15 * var(--letter-unit));
    font-size: calc(.875 * var(--letter-unit));
  }
  .winter-letter__download {
    display: grid;
    grid-template-columns: calc(7.3125 * var(--letter-unit)) calc(1.25 * var(--letter-unit));
    gap: calc(.5625 * var(--letter-unit));
    width: calc(14.5625 * var(--letter-unit));
    min-height: calc(4.1875 * var(--letter-unit));
    margin-top: calc(2.28125 * var(--letter-unit));
    margin-left: calc(-.6875 * var(--letter-unit));
    padding: calc(1 * var(--letter-unit)) calc(2.625 * var(--letter-unit)) calc(1 * var(--letter-unit)) calc(2.8125 * var(--letter-unit));
    font-size: calc(.9375 * var(--letter-unit));
    line-height: .9;
  }
  .winter-letter__artwork {
    position: absolute;
    inset: -1px;
    z-index: -1;
    height: auto;
    min-height: 0;
    margin-top: 0;
    aspect-ratio: auto;
  }
  .winter-letter__artwork img { object-position: center; }
}
