/* Use the same ground as Instagram. Only the fine top rule marks the pause. */
.eri-letter {
  font-family: var(--font-serif); color: var(--color-ink);
  background: var(--color-blush);
  padding-bottom: clamp(24px, 3.5vw, 56px);
  scroll-margin-block-start: clamp(70px, 20vh, 186px);
}
.eri-letter__inner {
  position: relative;
  width: min(calc(100% - 2 * var(--section-gutter)), var(--container));
  margin-inline: auto; padding-block: clamp(20px, 2.6vw, 38px);
  display: grid; align-items: center; justify-content: center;
  grid-template-columns: max-content max-content max-content;
  gap: 0 clamp(22px, 3.4vw, 54px);
  border-top: 1px solid #d9cbb9;
  /* Both colour fields end in transparency before the section's edges. */
  background:
    radial-gradient(ellipse 37% 48% at 39% 50%, rgb(255 250 247 / .85), transparent 100%),
    radial-gradient(ellipse 20% 43% at 78% 51%, rgb(229 239 244 / .62), transparent 100%);
}
/* The decoration has no grid footprint and never catches a tap. */
.eri-letter__petals { position: absolute; inset: 0; pointer-events: none; }
.eri-letter__petals i {
  position: absolute; width: var(--size); aspect-ratio: 1;
  left: var(--x); top: var(--y);
  transform: translate(-50%, -50%) rotate(var(--turn));
  background: url("../images/retake/message-petals.webp") var(--frame) center / 400% 100% no-repeat;
  opacity: var(--strength);
}
.eri-letter__petals i:nth-child(1) {
  --x: 5.7%; --y: 32%; --size: clamp(26px, 2.8vw, 40px); --frame: 0%; --turn: -24deg; --strength: .82;
}
.eri-letter__petals i:nth-child(2) {
  --x: 19%; --y: 15%; --size: clamp(18px, 1.8vw, 26px); --frame: 33.3333%; --turn: 49deg; --strength: .68;
}
.eri-letter__petals i:nth-child(3) {
  --x: 30%; --y: 79%; --size: clamp(19px, 2vw, 28px); --frame: 66.6667%; --turn: -54deg; --strength: .7;
}
.eri-letter__petals i:nth-child(4) {
  --x: 94.5%; --y: 68%; --size: clamp(16px, 1.6vw, 23px); --frame: 100%; --turn: 12deg; --strength: .62;
}
.eri-letter__petals i:nth-child(5) {
  --x: 87%; --y: calc(clamp(20px, 2.6vw, 38px) - 15px); --size: clamp(14px, 1.4vw, 20px); --frame: 0%; --turn: 46deg; --strength: .65;
}
.eri-letter__title {
  margin: 0; color: var(--color-brand-deep);
  font: 500 clamp(26px, 2.7vw, 42px)/1.32 var(--font-serif); letter-spacing: .09em;
}
.eri-letter__title span { display: block; white-space: nowrap; }
.eri-letter__title span + span { padding-left: .62em; }
.eri-letter__title b { font-weight: inherit; font-size: 1.48em; color: var(--color-brand); }
.eri-letter__verse { font-size: clamp(15px, 1.2vw, 18px); line-height: 1.95; letter-spacing: .045em; }
.eri-letter__verse p { margin: 0; }
.eri-letter__verse p + p { margin-top: .45em; }
.eri-letter__verse span { display: inline-block; }
.eri-letter__portrait {
  position: relative; height: clamp(240px, 25vw, 345px); aspect-ratio: .72;
  overflow: hidden;
  /* Keep the portrait in its own colours; dissolve only its four edges. */
  mask-image:
    linear-gradient(90deg, transparent, rgb(0 0 0 / .3) 5%, #000 19%, #000 77%, rgb(0 0 0 / .45) 92%, transparent),
    linear-gradient(180deg, transparent, #000 12%, #000 88%, rgb(0 0 0 / .77) 94%, transparent);
  mask-composite: intersect;
}
.eri-letter__portrait img {
  display: block; position: absolute; top: 0; right: 0;
  width: 100%; max-width: none; height: 100%; object-fit: cover; object-position: 50% 50%;
}
@media (min-width: 921px) and (max-width: 1199px) {
  .eri-letter__petals i:nth-child(1) { --x: 3%; --y: 24%; }
  .eri-letter__petals i:nth-child(3) { --x: 25%; --y: 84%; }
  .eri-letter__petals i:nth-child(4) { --x: 97.5%; }
}
@media (max-width: 1024px) {
  .eri-letter__inner {
    --text-inset: clamp(16px, 6.8vw, 32px);
    grid-template-columns: minmax(0, 280px) auto;
    column-gap: 0; padding-block: clamp(15px, 3.8vw, 28px) 24px;
    background:
      radial-gradient(ellipse 46% 43% at 46% 55%, rgb(255 250 247 / .8), transparent),
      radial-gradient(ellipse 22% 24% at 76% 27%, rgb(229 239 244 / .55), transparent);
  }
  .eri-letter__title {
    grid-area: 1 / 1; justify-self: start; margin-inline-start: var(--text-inset);
    font-size: clamp(21px, 5.6vw, 34px);
  }
  .eri-letter__portrait {
    grid-area: 1 / 2; height: clamp(128px, 41vw, 228px); margin-inline: 4px clamp(10px, 4vw, 24px);
  }
  .eri-letter__verse {
    grid-area: 2 / 1 / 3 / -1; margin-inline: var(--text-inset); padding-top: clamp(12px, 2.2vw, 19px);
    font-size: clamp(14px, 3.8vw, 17px); line-height: 1.85;
  }
  .eri-letter__petals i:nth-child(3),
  .eri-letter__petals i:nth-child(4) { display: none; }
}
/* The tablet copy now sits below. Keep the ornament's original reference
   height so moving the paragraph cannot drag the surviving petals with it. */
@media (min-width: 921px) and (max-width: 1024px) {
  .eri-letter__petals { bottom: auto; height: calc(clamp(240px, 25vw, 345px) + 2 * clamp(20px, 2.6vw, 38px)); }
}
@media (min-width: 681px) and (max-width: 920px) {
  .eri-letter__petals { bottom: auto; height: calc(max(224px, 26vw) + 2 * clamp(20px, 2.6vw, 38px)); }
  .eri-letter__petals i:nth-child(1) { --x: 1%; --y: 23%; --size: 22px; }
  .eri-letter__petals i:nth-child(2) { --x: 32%; --y: 11px; --size: 12px; }
  .eri-letter__petals i:nth-child(5) { --x: 86%; --y: 5%; --size: 14px; }
}
@media (max-width: 680px) {
  .eri-letter__inner { width: min(calc(100% - 40px), 440px); grid-template-columns: minmax(0, 1fr) auto; padding-block: 15px 24px; }
  .eri-letter__title { font-size: clamp(21px, 5.6vw, 31px); }
  .eri-letter__portrait { height: clamp(128px, 41vw, 192px); }
  .eri-letter__verse { padding-top: 12px; font-size: clamp(14px, 3.8vw, 16px); }
  .eri-letter__petals i:nth-child(1) { --x: 3%; --y: 13%; --size: 22px; }
  .eri-letter__petals i:nth-child(2) { --x: 34%; --y: 8%; --size: 16px; }
  .eri-letter__petals i:nth-child(5) { --x: 98.5%; --y: 21%; --size: 13px; }
}
@media (max-width: 374px) {
  .eri-letter__inner { --text-inset: 13px; }
  .eri-letter__petals i:nth-child(1) { --x: 6%; --y: 6%; --size: 18px; }
  .eri-letter__petals i:nth-child(2) { --x: 41%; --y: 4%; --size: 12px; }
  .eri-letter__petals i:nth-child(5) { --x: 99%; --size: 12px; }
}
