/* ==========================================================================
   Vaytax. Letter-read demo motif (2026-07-16).
   Shows a German Finanzamt letter being read into English, before the visitor
   uploads anything. Mounted by letter-demo.js into [data-letter-demo].
   Tokens borrowed from the host page (same set letter-decode.css uses):
     --primary --primary-dark --gold --cream --border-soft --paragraph
     --body-text --font-ui --font-mono. Fallbacks inline so it can also sit on
   pages that define fewer tokens (e.g. the homepage).
   Motion follows the house pattern (product/amazon-fba): elements are visible
   by default; JS adds .ld-animate to opt INTO the reveal, so no-JS and
   prefers-reduced-motion both land on the full static composition.
   ========================================================================== */

.ld-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: stretch;
  max-width: 780px;
  margin: 0 auto;
}

/* --- the letter (left) --------------------------------------------------- */
.ld-letter {
  background: #f7f5f0;
  border: 1px solid #e3ded2;
  border-radius: 8px;
  padding: 20px 18px;
  font-family: var(--font-mono, 'Roboto Mono', monospace);
  font-size: 10.5px;
  line-height: 1.75;
  color: #3f3d38;
  box-shadow: 0 8px 24px rgba(20, 32, 59, .08);
  position: relative;
  overflow: hidden;
}
.ld-letter .ld-fa { font-weight: 600; color: #14203b; font-size: 11px; }
.ld-letter .ld-dim { color: #8d8a83; }
.ld-hl {
  background: #fff3c4;
  color: #7a5a10;
  font-weight: 600;
  padding: 1px 3px;
  border-radius: 2px;
}

/* scan sweep, purely decorative */
.ld-scan {
  position: absolute; left: 0; right: 0; top: 0; height: 42%;
  background: linear-gradient(180deg, rgba(35,57,133,0) 0%, rgba(35,57,133,.10) 60%, rgba(35,57,133,0) 100%);
  opacity: 0; pointer-events: none;
}
.ld-animate .ld-scan.ld-run { animation: ld-sweep 1.15s cubic-bezier(.4,0,.2,1) 1; }
@keyframes ld-sweep {
  0%   { opacity: 0; transform: translateY(-60%); }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(210%); }
}

/* --- the read (right) ---------------------------------------------------- */
.ld-read {
  background: #fff;
  border: 1px solid var(--border-soft, #e6e6e6);
  border-radius: 8px;
  padding: 18px 18px 16px;
  box-shadow: 0 8px 24px rgba(20, 32, 59, .10);
  display: flex;
  flex-direction: column;
}
.ld-pill {
  align-self: flex-start;
  font-family: var(--font-ui, 'Montserrat', sans-serif);
  font-size: 10px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--primary, #233985);
  background: var(--cream, #faf8f3);
  border: 1px solid var(--border-soft, #e6e6e6);
  border-radius: 99px;
  padding: 4px 11px;
  margin: 0 0 12px;
}
.ld-h {
  font-family: var(--font-ui, 'Montserrat', sans-serif);
  font-size: 9.5px; font-weight: 600; letter-spacing: 1.3px; text-transform: uppercase;
  color: var(--gold, #8a6d3b);
  margin: 10px 0 4px;
}
.ld-row {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 12.5px; color: var(--body-text, #262626);
  padding: 5px 0;
  border-bottom: 1px solid #f0eee9;
}
.ld-row .ld-v { font-family: var(--font-mono, 'Roboto Mono', monospace); white-space: nowrap; }
.ld-foot {
  margin-top: auto; padding-top: 12px;
  font-size: 11.5px; color: var(--paragraph, #7a7a7a);
}

/* --- reveal: opt-in via .ld-animate (added by JS) ------------------------ */
.ld-animate .ld-step { opacity: 0; transform: translateY(6px); }
.ld-animate .ld-step.ld-in {
  opacity: 1; transform: none;
  transition: opacity .38s cubic-bezier(.2,.8,.2,1), transform .38s cubic-bezier(.2,.8,.2,1);
}

.ld-cap {
  text-align: center;
  font-size: 12.5px;
  color: var(--paragraph, #7a7a7a);
  margin: 14px 0 0;
  line-height: 1.55;
}

@media (max-width: 680px) {
  .ld-wrap { grid-template-columns: 1fr; gap: 14px; }
  .ld-letter { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .ld-animate .ld-step { opacity: 1 !important; transform: none !important; }
  .ld-animate .ld-scan { animation: none !important; opacity: 0 !important; }
}
