/* Folded cotton stationery on the same burgundy ground as its envelope. */
#words.reader {
  --desk: #432331;
  --paper: #f5ecdb;
  --ink: #312724;
  --rose-ink: #6c3741;
  --muted-ink: #76544b;
  --reader-ui: #f1dece;
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  margin: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
    max(20px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  border: 0;
  box-shadow: none;
  overflow: auto;
  overscroll-behavior: contain;
  color: var(--ink);
  background: radial-gradient(ellipse at 50% 16%, #613845 0%, var(--desk) 67%, #371e2a 100%);
}
#words[open] { display: flex; flex-direction: column; }
#words::backdrop { background: #432331; }
.reader-stage {
  width: min(100%, 38rem);
  margin: auto;
  flex: none;
}
.reader-tools {
  display: flex;
  justify-content: flex-end;
  margin-bottom: .32rem;
}
#words .fold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .48em;
  min-height: 44px;
  background: transparent;
  border: 0;
  padding: .3em .58em;
  color: var(--reader-ui);
  font: 400 .875rem/1.45 system-ui, sans-serif;
  text-wrap: balance;
}
#words .fold svg {
  flex: none;
  width: 1.15em;
  height: 1.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#words .fold:hover { color: white; }
#words .fold:focus-visible {
  outline: 2px solid #edcba5;
  outline-offset: 2px;
  border-radius: 2px;
}
#words .reader-stage > .reader-return {
  display: flex;
  justify-content: flex-end;
  margin: .25rem 0 0;
}
#words .letter-continuation {
  display: flex;
  justify-content: flex-end;
  margin-top: .35rem;
}
#words .wish-entry {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--rose-ink);
  font: 400 .96rem/1.6 LetterKai, var(--serif);
  letter-spacing: .07em;
  text-decoration: underline;
  text-decoration-color: #a96e73;
  text-underline-offset: .31em;
}
#words .wish-entry:is(:hover,:active,[data-tap]) {
  color: #542531;
  text-decoration-color: currentColor;
}
#words .wish-entry:focus-visible { outline: 2px solid var(--rose-ink); outline-offset: 3px; }
#words .reader-return .fold-end {
  color: #e6cbbf;
  text-decoration: underline;
  text-decoration-color: #bc8d88;
  text-underline-offset: .27em;
}
#words .reader-return .fold-end:hover { color: #fff4ea; }


#words .letter-sheet {
  position: relative;
  display: block;
  margin: 0;
  height: auto;
  padding: clamp(30px, 5vw, 55px) clamp(23px, 6.5vw, 73px)
    clamp(31px, 5vw, 52px);
  background:
    url('art/letter-fibre.png'),
    linear-gradient(174deg, transparent 48.75%, #7758360c 50.15%, #fffbeb55 50.35%, transparent 52%),
    linear-gradient(149deg, #faf4e8, var(--paper) 56%, #f1e5d3);
  border: 1px solid #faf1e2;
  border-radius: 1px 3px 2px 1px;
  box-shadow: 0 1px 1px #a58b6f80 inset, 0 23px 52px -20px #190d14bb, 0 3px 6px #29142150;
}
#words .letter-heading {
  display: block;
  border: 0;
  margin: 0;
  color: var(--rose-ink);
}
.letter-heading time {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: .75rem;
  width: fit-content;
  margin: 0 0 clamp(1.35rem, 4.4vw, 2.35rem) auto;
  font: 400 .79rem/1.55 LetterSong, var(--serif);
  letter-spacing: .11em;
  color: var(--muted-ink);
}
.letter-heading time::before {
  content: "";
  width: 1.35em;
  height: 1px;
  flex: none;
  background: currentColor;
  opacity: .42;
}
.letter-heading h2 {
  width: fit-content;
  margin: 0 0 .72em;
  font: 400 clamp(1.5rem, 1.14rem + 1.35vw, 2.15rem)/1.46 LetterKai, var(--serif);
  letter-spacing: .028em;
  overflow-wrap: anywhere;
}
.letter-heading h2:focus { outline: none; }
#words .sheet-body {
  overflow: visible;
  min-height: 0;
  margin: 0;
  font: 400 clamp(1rem, .92rem + .34vw, 1.14rem)/1.92 LetterSong, var(--serif);
  color: var(--ink);
  line-break: strict;
  overflow-wrap: anywhere;
}
#words .sheet-body p { margin: 0; text-wrap: pretty; }
#words .sheet-body .letter-tail { white-space: nowrap; }
#words .sheet-body p + p { margin-top: .82em; }
#words .sheet-body .letter-lede {
  color: #54332e;
  font-family: LetterKai, var(--serif);
  font-size: 1.11em;
  line-height: 1.72;
  margin-bottom: 1.05em;
}
#words .sheet-body p.letter-wish { margin-top: 1.12em; }
#words .sheet-body .letter-blessing { color: var(--rose-ink); }
.letter-signoff {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: end;
  gap: .75rem;
  margin-top: clamp(1.4rem, 5vw, 2rem);
  color: var(--rose-ink);
}
.letter-signoff .signature {
  margin: 0 0 .16em;
  text-align: right;
  font: 400 clamp(1.04rem, .96rem + .44vw, 1.3rem)/1.55 LetterKai, var(--serif);
  letter-spacing: .046em;
  overflow-wrap: anywhere;
}
.letter-flower {
  display: block;
  width: clamp(48px, 12vw, 76px);
  height: auto;
  color: #87505a;
  transform: rotate(-7deg);
}
#words .letter-sheet .letter-postscript {
  margin: clamp(1.55rem, 5.5vw, 2.1rem) 0 0;
  padding-top: .75em;
  border-top: 1px solid #93596949;
  color: #644842;
  font: 400 clamp(.9rem, .84rem + .24vw, 1rem)/1.75 LetterKai, var(--serif);
  overflow-wrap: anywhere;
}
@media (max-width: 480px) {
  #words .letter-sheet { padding-inline: clamp(19px, 6.3vw, 30px); }
}

