/* ---------------------------------------------------------
   LA CARTA
   Papel, tinta y pequeños gestos
   --------------------------------------------------------- */

.letter-backdrop {
  --paper-edge: rgba(116, 128, 85, .26);
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 42px) 18px;
  perspective: 1600px;
}

.letter-backdrop[hidden] {
  display: none;
}

.letter-backdrop__veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(6, 19, 13, .48) 0%, rgba(3, 11, 8, .72) 66%, rgba(3, 11, 8, .86) 100%);
  opacity: 0;
  transition: opacity .55s var(--ease-soft);
  -webkit-backdrop-filter: blur(4px) saturate(82%);
  backdrop-filter: blur(4px) saturate(82%);
}

.letter-backdrop.is-open .letter-backdrop__veil {
  opacity: 1;
}

.letter-card {
  position: relative;
  width: min(660px, 100%);
  max-height: min(88dvh, 880px);
  border: 1px solid rgba(132, 139, 94, .28);
  border-radius: 5px;
  background: var(--paper);
  color: var(--ink);
  box-shadow:
    0 40px 120px rgba(0, 0, 0, .62),
    0 8px 28px rgba(0, 0, 0, .38),
    0 0 0 1px rgba(255, 248, 235, .28) inset;
  opacity: 0;
  transform: translateY(28px) rotateX(7deg) scale(.93);
  transform-origin: 50% 20%;
  transition: opacity .3s var(--ease-soft), transform .3s var(--ease-soft);
  outline: none;
  overflow: hidden;
}

.letter-backdrop.is-open .letter-card {
  animation: letterOpen .78s cubic-bezier(.16, .82, .24, 1) both;
}

.letter-backdrop.is-closing .letter-card {
  opacity: 0;
  transform: translateY(18px) rotateX(3deg) scale(.965);
}

.letter-card__paper {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: 4px;
  background:
    radial-gradient(ellipse at 18% 0%, rgba(255, 255, 255, .8) 0%, transparent 48%),
    radial-gradient(ellipse at 100% 100%, rgba(186, 193, 148, .15) 0%, transparent 58%),
    radial-gradient(ellipse at 0% 100%, rgba(143, 165, 137, .08) 0%, transparent 45%),
    linear-gradient(135deg, #f7f1dd 0%, #f4efdc 50%, #efe9d2 100%);
  pointer-events: none;
}

.letter-card__paper::before {
  content: "";
  position: absolute;
  inset: 11px;
  border: 1px solid rgba(132, 139, 94, .20);
  border-radius: 1px;
  pointer-events: none;
}

.letter-card__paper::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .035;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='paperNoise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23paperNoise)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  pointer-events: none;
}

.letter-card__scroll {
  position: relative;
  z-index: 2;
  max-height: min(88dvh, 880px);
  padding: clamp(42px, 6vw, 66px) clamp(30px, 7vw, 68px) 36px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(112, 125, 83, .32) transparent;
  transition: opacity .22s ease, filter .22s ease;
}

.letter-card.is-turning .letter-card__scroll {
  opacity: .22;
  filter: blur(2px);
}

.letter-card__scroll::-webkit-scrollbar {
  width: 8px;
}

.letter-card__scroll::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 10px;
  background: rgba(112, 125, 83, .28);
  background-clip: padding-box;
}

.letter-card__scroll::-webkit-scrollbar-track {
  background: transparent;
}

.letter-card__ornament {
  position: absolute;
  z-index: 3;
  font-family: var(--serif);
  font-size: 10px;
  line-height: 1;
  color: rgba(139, 151, 93, .55);
  pointer-events: none;
}

.letter-card__ornament--tl {
  top: 21px;
  left: 23px;
}

.letter-card__ornament--tr {
  top: 21px;
  right: 23px;
}

.letter-card__ornament--bl {
  bottom: 21px;
  left: 23px;
}

.letter-card__ornament--br {
  right: 23px;
  bottom: 21px;
}

.letter-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(112, 125, 83, .18);
  border-radius: 50%;
  background: rgba(255, 252, 244, .35);
  color: rgba(48, 72, 54, .70);
  cursor: pointer;
  transition: color .3s ease, background-color .3s ease, border-color .3s ease, transform .3s ease;
}

.letter-close:hover {
  color: rgba(27, 48, 33, .95);
  background: rgba(255, 252, 244, .78);
  border-color: rgba(112, 125, 83, .30);
  transform: rotate(5deg);
}

.letter-close:focus-visible,
.letter-actions button:focus-visible {
  outline-color: rgba(38, 65, 46, .7);
}

.letter-close svg {
  width: 15px;
  height: 15px;
}

.letter-head {
  text-align: center;
}

.letter-kicker {
  margin: 0 0 15px;
  font-family: var(--sans);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: .26em;
  line-height: 1.6;
  text-transform: uppercase;
  color: rgba(94, 112, 71, .82);
}

.letter-expression {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.35rem, 4.2vw, 3.2rem);
  font-weight: 400;
  line-height: 1.22;
  letter-spacing: -.012em;
  color: #23382a;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.letter-card .letter-expression.is-long {
  font-size: clamp(1.55rem, 2.9vw, 2.12rem);
  line-height: 1.36;
}

.letter-language {
  margin: 12px 0 0;
  font-family: var(--sans);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: .2em;
  line-height: 1.7;
  text-transform: uppercase;
  color: rgba(83, 101, 75, .68);
}

.letter-language__dot {
  padding: 0 7px;
  color: rgba(126, 140, 92, .48);
}

#letter-native-name {
  text-transform: none;
  letter-spacing: .09em;
}

.letter-rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  width: min(260px, 70%);
  margin: 24px auto 26px;
}

.letter-rule span {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(126, 140, 92, .30));
}

.letter-rule span:last-child {
  background: linear-gradient(90deg, rgba(126, 140, 92, .30), transparent);
}

.letter-rule svg {
  width: 9px;
  height: 9px;
  fill: rgba(135, 148, 96, .72);
}

.letter-body {
  text-align: center;
}

.letter-poem {
  margin: 0 auto;
  max-width: 540px;
  font-family: var(--serif);
  font-size: clamp(1.22rem, 2.1vw, 1.48rem);
  font-weight: 400;
  line-height: 1.73;
  letter-spacing: .006em;
  color: #2d4132;
  white-space: pre-line;
  overflow-wrap: break-word;
  text-wrap: pretty;
}

.letter-poem[dir="rtl"] {
  text-align: right;
  max-width: 560px;
}

.letter-farewell {
  margin: 22px auto 0;
  max-width: 500px;
  font-family: var(--serif);
  font-size: 1.03rem;
  font-style: italic;
  line-height: 1.6;
  color: rgba(86, 105, 81, .92);
  overflow-wrap: break-word;
}

.letter-farewell[dir="rtl"] {
  text-align: right;
  font-style: normal;
}

.letter-translation {
  position: relative;
  margin: clamp(26px, 4.5vh, 38px) auto 0;
  padding: 20px 24px 19px;
  border: 1px solid rgba(126, 140, 92, .18);
  border-radius: 2px;
  background:
    linear-gradient(135deg, rgba(131, 151, 103, .06), rgba(255, 255, 255, .13)),
    rgba(131, 151, 103, .04);
  text-align: left;
}

.letter-translation::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 24px;
  right: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139, 158, 104, .36), transparent);
}

.letter-translation__label {
  margin: 0 0 11px;
  font-family: var(--sans);
  font-size: 7.5px;
  font-weight: 600;
  letter-spacing: .21em;
  line-height: 1.4;
  text-transform: uppercase;
  color: rgba(95, 117, 72, .84);
}

.letter-translation__label span {
  padding-right: 5px;
  font-size: 8px;
  color: rgba(133, 151, 94, .68);
}

.letter-translation__text {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.7;
  color: #4e6552;
  white-space: pre-line;
  overflow-wrap: break-word;
}

.letter-translation__farewell {
  margin: 9px 0 0;
  font-family: var(--serif);
  font-size: .96rem;
  font-style: italic;
  line-height: 1.55;
  color: rgba(86, 105, 81, .85);
}

.letter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 22px;
  margin-top: clamp(25px, 4.2vh, 36px);
}

.btn--paper {
  gap: 10px;
  padding: 0 22px;
  min-height: 43px;
  color: #f3efdc;
  background: linear-gradient(135deg, #2d513e 0%, #1e3a2b 100%);
  box-shadow:
    0 9px 22px rgba(29, 56, 40, .20),
    inset 0 1px 0 rgba(255, 249, 240, .14);
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: .055em;
}

.btn--paper:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #39634b 0%, #284632 100%);
  box-shadow:
    0 13px 28px rgba(29, 56, 40, .26),
    inset 0 1px 0 rgba(255, 249, 240, .17);
}

.btn--paper svg {
  width: 13px;
  height: 13px;
  fill: rgba(213, 232, 198, .9);
}

.letter-back {
  position: relative;
  min-height: 38px;
  padding: 0 2px;
  border: 0;
  border-bottom: 1px solid rgba(86, 105, 81, .26);
  border-radius: 0;
  background: transparent;
  color: rgba(55, 80, 59, .78);
  font-family: var(--sans);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .3s ease, border-color .3s ease;
}

.letter-back:hover {
  color: rgba(27, 50, 33, .96);
  border-color: rgba(58, 85, 61, .50);
}

.letter-signature {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  margin: 22px 0 0;
  font-family: var(--serif);
  font-size: .82rem;
  font-style: italic;
  letter-spacing: .12em;
  color: rgba(101, 120, 86, .60);
}

.letter-signature span {
  width: 22px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(126, 140, 92, .30));
}

.letter-signature span:last-child {
  background: linear-gradient(90deg, rgba(126, 140, 92, .30), transparent);
}

/* ---------- Escrituras y direccionalidad ---------- */

.letter-card[data-script="arabic"] .letter-expression,
.letter-card[data-script="arabic"] .letter-poem,
.letter-card[data-script="arabic"] .letter-farewell {
  font-family: "Noto Naskh Arabic", "Amiri", "Traditional Arabic", "Segoe UI", Tahoma, sans-serif;
}

.letter-card[data-script="arabic"] .letter-expression {
  font-size: clamp(2.55rem, 4.7vw, 3.55rem);
  line-height: 1.55;
}

.letter-card[data-script="arabic"] .letter-poem {
  font-size: clamp(1.18rem, 2.1vw, 1.42rem);
  line-height: 2.05;
  letter-spacing: 0;
}

.letter-card[data-script="hebrew"] .letter-expression,
.letter-card[data-script="hebrew"] .letter-poem,
.letter-card[data-script="hebrew"] .letter-farewell {
  font-family: "Noto Serif Hebrew", "Frank Ruhl Libre", David, "Segoe UI", serif;
}

.letter-card[data-script="hebrew"] .letter-expression {
  font-size: clamp(2.3rem, 4vw, 3.1rem);
  line-height: 1.5;
}

.letter-card[data-script="hebrew"] .letter-poem {
  font-size: clamp(1.15rem, 2vw, 1.38rem);
  line-height: 1.95;
}

.letter-card[data-script="devanagari"] .letter-expression,
.letter-card[data-script="devanagari"] .letter-poem,
.letter-card[data-script="devanagari"] .letter-farewell {
  font-family: "Noto Serif Devanagari", "Nirmala UI", Mangal, serif;
}

.letter-card[data-script="bengali"] .letter-expression,
.letter-card[data-script="bengali"] .letter-poem,
.letter-card[data-script="bengali"] .letter-farewell {
  font-family: "Noto Serif Bengali", "Nirmala UI", Vrinda, serif;
}

.letter-card[data-script="gurmukhi"] .letter-expression,
.letter-card[data-script="gurmukhi"] .letter-poem,
.letter-card[data-script="gurmukhi"] .letter-farewell {
  font-family: "Noto Serif Gurmukhi", "Nirmala UI", Raavi, serif;
}

.letter-card[data-script="gujarati"] .letter-expression,
.letter-card[data-script="gujarati"] .letter-poem,
.letter-card[data-script="gujarati"] .letter-farewell {
  font-family: "Noto Serif Gujarati", "Nirmala UI", Shruti, serif;
}

.letter-card[data-script="tamil"] .letter-expression,
.letter-card[data-script="tamil"] .letter-poem,
.letter-card[data-script="tamil"] .letter-farewell {
  font-family: "Noto Serif Tamil", "Nirmala UI", Latha, serif;
}

.letter-card[data-script="telugu"] .letter-expression,
.letter-card[data-script="telugu"] .letter-poem,
.letter-card[data-script="telugu"] .letter-farewell {
  font-family: "Noto Serif Telugu", "Nirmala UI", Gautami, serif;
}

.letter-card[data-script="kannada"] .letter-expression,
.letter-card[data-script="kannada"] .letter-poem,
.letter-card[data-script="kannada"] .letter-farewell {
  font-family: "Noto Serif Kannada", "Nirmala UI", Tunga, serif;
}

.letter-card[data-script="malayalam"] .letter-expression,
.letter-card[data-script="malayalam"] .letter-poem,
.letter-card[data-script="malayalam"] .letter-farewell {
  font-family: "Noto Serif Malayalam", "Nirmala UI", Kartika, serif;
}

.letter-card[data-script="sinhala"] .letter-expression,
.letter-card[data-script="sinhala"] .letter-poem,
.letter-card[data-script="sinhala"] .letter-farewell {
  font-family: "Noto Serif Sinhala", "Iskoola Pota", "Nirmala UI", serif;
}

.letter-card[data-script="odia"] .letter-expression,
.letter-card[data-script="odia"] .letter-poem,
.letter-card[data-script="odia"] .letter-farewell {
  font-family: "Noto Serif Oriya", "Nirmala UI", Kalinga, serif;
}

.letter-card[data-script="odia"] .letter-expression {
  font-size: clamp(2rem, 3.7vw, 2.8rem);
  line-height: 1.55;
}

.letter-card[data-script="odia"] .letter-poem {
  line-height: 1.95;
}

.letter-card[data-script="thaana"] .letter-expression,
.letter-card[data-script="thaana"] .letter-poem,
.letter-card[data-script="thaana"] .letter-farewell {
  font-family: "MV Boli", "Noto Sans Thaana", "Segoe UI", sans-serif;
}

.letter-card[data-script="thaana"] .letter-expression {
  font-size: clamp(2rem, 3.8vw, 2.9rem);
  line-height: 1.7;
}

.letter-card[data-script="thaana"] .letter-poem {
  line-height: 2.1;
}

.letter-card[data-script="thai"] .letter-expression,
.letter-card[data-script="thai"] .letter-poem,
.letter-card[data-script="thai"] .letter-farewell {
  font-family: "Noto Serif Thai", "Leelawadee UI", Tahoma, serif;
}

.letter-card[data-script="thai"] .letter-expression,
.letter-card[data-script="lao"] .letter-expression,
.letter-card[data-script="khmer"] .letter-expression,
.letter-card[data-script="myanmar"] .letter-expression {
  font-size: clamp(2.15rem, 3.9vw, 2.95rem);
  line-height: 1.55;
}

.letter-card[data-script="thai"] .letter-poem,
.letter-card[data-script="lao"] .letter-poem,
.letter-card[data-script="khmer"] .letter-poem,
.letter-card[data-script="myanmar"] .letter-poem {
  line-height: 2.05;
}

.letter-card[data-script="lao"] .letter-expression,
.letter-card[data-script="lao"] .letter-poem,
.letter-card[data-script="lao"] .letter-farewell {
  font-family: "Noto Serif Lao", "Leelawadee UI", DokChampa, serif;
}

.letter-card[data-script="khmer"] .letter-expression,
.letter-card[data-script="khmer"] .letter-poem,
.letter-card[data-script="khmer"] .letter-farewell {
  font-family: "Noto Serif Khmer", "Khmer UI", Leelawadee UI, serif;
}

.letter-card[data-script="myanmar"] .letter-expression,
.letter-card[data-script="myanmar"] .letter-poem,
.letter-card[data-script="myanmar"] .letter-farewell {
  font-family: "Noto Serif Myanmar", "Myanmar Text", Padauk, serif;
}

.letter-card[data-script="ethiopic"] .letter-expression,
.letter-card[data-script="ethiopic"] .letter-poem,
.letter-card[data-script="ethiopic"] .letter-farewell {
  font-family: "Noto Serif Ethiopic", Nyala, serif;
}

.letter-card[data-script="ethiopic"] .letter-expression {
  font-size: clamp(2.1rem, 3.8vw, 2.9rem);
  line-height: 1.55;
}

.letter-card[data-script="tibetan"] .letter-expression,
.letter-card[data-script="tibetan"] .letter-poem,
.letter-card[data-script="tibetan"] .letter-farewell {
  font-family: "Noto Serif Tibetan", "Microsoft Himalaya", Kailasa, serif;
}

.letter-card[data-script="tibetan"] .letter-expression {
  font-size: clamp(2rem, 3.7vw, 2.8rem);
  line-height: 1.75;
}

.letter-card[data-script="tibetan"] .letter-poem {
  line-height: 2.15;
}

.letter-card[data-script="cjk"] .letter-expression,
.letter-card[data-script="cjk"] .letter-poem,
.letter-card[data-script="cjk"] .letter-farewell,
.letter-card[data-script="korean"] .letter-expression,
.letter-card[data-script="korean"] .letter-poem,
.letter-card[data-script="korean"] .letter-farewell {
  font-family: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif CJK JP", "Songti SC", "SimSun", "Batang", serif;
}

.letter-card[data-script="cjk"] .letter-expression {
  font-size: clamp(2.6rem, 4.8vw, 3.6rem);
  letter-spacing: .04em;
}

.letter-card[data-script="cjk"] .letter-poem {
  font-size: clamp(1.2rem, 2.1vw, 1.45rem);
  line-height: 2.1;
  letter-spacing: .035em;
}

.letter-card[data-script="korean"] .letter-expression {
  font-size: clamp(2.45rem, 4.4vw, 3.3rem);
  letter-spacing: .005em;
}

.letter-card[data-script="korean"] .letter-poem {
  font-size: clamp(1.14rem, 2vw, 1.35rem);
  line-height: 2;
  letter-spacing: .01em;
}

.letter-card[data-script="georgian"] .letter-expression,
.letter-card[data-script="georgian"] .letter-poem,
.letter-card[data-script="georgian"] .letter-farewell {
  font-family: "Noto Serif Georgian", Sylfaen, serif;
}

.letter-card[data-script="armenian"] .letter-expression,
.letter-card[data-script="armenian"] .letter-poem,
.letter-card[data-script="armenian"] .letter-farewell {
  font-family: "Noto Serif Armenian", Sylfaen, serif;
}

.letter-card[data-script="greek"] .letter-expression,
.letter-card[data-script="greek"] .letter-poem,
.letter-card[data-script="greek"] .letter-farewell {
  font-family: "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
}

.letter-card[data-script="devanagari"] .letter-expression,
.letter-card[data-script="bengali"] .letter-expression,
.letter-card[data-script="gurmukhi"] .letter-expression,
.letter-card[data-script="gujarati"] .letter-expression,
.letter-card[data-script="tamil"] .letter-expression,
.letter-card[data-script="telugu"] .letter-expression,
.letter-card[data-script="kannada"] .letter-expression,
.letter-card[data-script="malayalam"] .letter-expression,
.letter-card[data-script="sinhala"] .letter-expression {
  font-size: clamp(2rem, 3.75vw, 2.85rem);
  line-height: 1.55;
}

.letter-card[data-script="devanagari"] .letter-poem,
.letter-card[data-script="bengali"] .letter-poem,
.letter-card[data-script="gurmukhi"] .letter-poem,
.letter-card[data-script="gujarati"] .letter-poem,
.letter-card[data-script="tamil"] .letter-poem,
.letter-card[data-script="telugu"] .letter-poem,
.letter-card[data-script="kannada"] .letter-poem,
.letter-card[data-script="malayalam"] .letter-poem,
.letter-card[data-script="sinhala"] .letter-poem {
  font-size: clamp(1.08rem, 1.9vw, 1.28rem);
  line-height: 1.95;
}

.letter-card[data-script="cyrillic"] .letter-expression,
.letter-card[data-script="cyrillic"] .letter-poem,
.letter-card[data-script="cyrillic"] .letter-farewell {
  font-family: "Cormorant Garamond", "Palatino Linotype", Georgia, serif;
}

/* ---------- Animación de apertura ---------- */

@keyframes letterOpen {
  0% {
    opacity: 0;
    transform: translateY(32px) rotateX(8deg) scale(.925);
  }
  55% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotateX(0) scale(1);
  }
}

@keyframes letterContentIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.letter-backdrop.is-open .letter-head,
.letter-backdrop.is-open .letter-body,
.letter-backdrop.is-open .letter-translation,
.letter-backdrop.is-open .letter-actions {
  animation: letterContentIn .65s var(--ease-out) both;
}

.letter-backdrop.is-open .letter-head { animation-delay: .22s; }
.letter-backdrop.is-open .letter-body { animation-delay: .31s; }
.letter-backdrop.is-open .letter-translation { animation-delay: .4s; }
.letter-backdrop.is-open .letter-actions { animation-delay: .48s; }

/* ---------- Adaptación de la carta ---------- */

@media (max-width: 620px) {
  .letter-backdrop {
    padding: 10px;
  }

  .letter-card {
    max-height: min(91dvh, 900px);
    border-radius: 4px;
  }

  .letter-card__scroll {
    max-height: min(91dvh, 900px);
    padding: 48px 24px 28px;
  }

  .letter-card__paper::before {
    inset: 7px;
  }

  .letter-card__ornament--tl,
  .letter-card__ornament--tr,
  .letter-card__ornament--bl,
  .letter-card__ornament--br {
    display: none;
  }

  .letter-close {
    top: 11px;
    right: 11px;
    width: 33px;
    height: 33px;
  }

  .letter-kicker {
    margin-bottom: 12px;
    font-size: 7.2px;
  }

  .letter-expression {
    font-size: clamp(1.95rem, 8.2vw, 2.7rem);
  }

  .letter-rule {
    margin: 19px auto 21px;
  }

  .letter-poem {
    font-size: clamp(1.1rem, 4.7vw, 1.28rem);
    line-height: 1.66;
  }

  .letter-translation {
    margin-top: 24px;
    padding: 17px 18px 16px;
  }

  .letter-translation__text {
    font-size: .98rem;
    line-height: 1.65;
  }

  .letter-actions {
    margin-top: 24px;
    gap: 13px;
  }

  .btn--paper {
    width: 100%;
    min-height: 44px;
  }

  .letter-back {
    min-height: 30px;
  }

  .letter-signature {
    margin-top: 17px;
  }
}

@media (max-width: 390px) {
  .letter-card__scroll {
    padding: 44px 19px 25px;
  }

  .letter-language {
    font-size: 7px;
    letter-spacing: .13em;
  }

  .letter-translation {
    padding: 15px 15px 14px;
  }
}

@media (max-height: 650px) {
  .letter-card__scroll {
    padding-top: 38px;
    padding-bottom: 24px;
  }

  .letter-rule {
    margin-top: 17px;
    margin-bottom: 19px;
  }

  .letter-translation {
    margin-top: 22px;
  }

  .letter-actions {
    margin-top: 22px;
  }

  .letter-signature {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .letter-backdrop.is-open .letter-card {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .letter-backdrop.is-open .letter-head,
  .letter-backdrop.is-open .letter-body,
  .letter-backdrop.is-open .letter-translation,
  .letter-backdrop.is-open .letter-actions {
    animation: none;
  }
}
