/* A folded keepsake becomes a garden, and each reader returns to its paper. */
.atmosphere::after {
  content:"";
  position:absolute;
  inset:-9%;
  pointer-events:none;
  opacity:0;
  background:
    radial-gradient(ellipse at 74% 60%, #ffd5a94a, transparent 34%),
    radial-gradient(ellipse at 45% 35%, #d8bbf332, transparent 37%);
}
body[data-motion="running"] .atmosphere::after {
  animation:evening-light 12s ease-in-out infinite alternate;
}
@keyframes evening-light {
  from {transform:translate3d(-5%,2%,0);opacity:.3}
  to {transform:translate3d(5%,-3%,0);opacity:.85}
}
body[data-reading] .atmosphere::after {animation-play-state:paused}
body[data-motion="running"] .secret-choice-flower,
body[data-motion="running"] .primary-button>span:last-child {
  transition:transform .46s cubic-bezier(.2,.8,.24,1);
}
body[data-motion="running"] .secret-choices button:is(:hover,:focus-visible) .secret-choice-flower {
  transform:rotate(-14deg) scale(1.1);
}
body[data-motion="running"] .primary-button:is(:hover,:focus-visible)>span:last-child {transform:translateX(4px)}
.paper-read{position:fixed;left:0;top:0;z-index:4;display:inline-flex;align-items:center;justify-content:center;gap:9px;min-height:44px;padding:6px 9px;border:1px solid #a37b8b66;border-radius:24px;background:#fff4e5e8;color:#74516a;font-size:11px;line-height:1.35;will-change:transform;transition:background .25s,box-shadow .25s,opacity .3s}
.paper-read{white-space:nowrap}.paper-read>span{font-size:17px}.paper-read:hover{background:#fff9ed;box-shadow:0 3px 15px #7048571f}.paper-read:focus-visible{outline-color:#81556e;outline-offset:3px}
dialog[open]{transform-origin:50% 50%}
dialog:not(.editor-dialog)::backdrop{background:#34244045;backdrop-filter:blur(2px);transition:opacity .42s ease}
dialog:not(.editor-dialog){box-shadow:0 30px 110px #2d173957,0 2px 4px #2d17391f;border-radius:5px;background:#fff3e0}
.memory-dialog{width:940px;border:1px solid #f8e6cd}.memory-image-wrap{background:#f3e3d0;border:15px solid #fff3e0;border-right:0;min-height:460px}.memory-image-wrap img{inset:0}.memory-copy{padding:67px 40px 32px;background:linear-gradient(90deg,#c2a68112,transparent 28%)}
.memory-copy #memoryCaption{white-space:pre-line}.memory-copy h2{font-size:46px}.memory-copy>p:last-of-type{line-height:1.85}.illustration-label{border-radius:12px}.dialog-navigation button{transition:background .2s,transform .2s}.dialog-navigation button:hover{background:#ead9d2}.dialog-navigation button:active{transform:scale(.94)}
.memory-image-wrap {position: relative; overflow: hidden}
.memory-dialog[data-photo-crop] {align-items: center}
.memory-dialog[data-photo-crop] .memory-image-wrap {
  box-sizing: content-box;
  width: calc(100% - 30px);
  height: auto;
  min-height: 0;
  max-height: none;
  aspect-ratio: var(--photo-frame-ratio);
  border: 15px solid #fff3e0;
}
.memory-image-wrap img[data-vertical-crop] {
  position: absolute;
  inset: var(--photo-frame-top) 0 auto;
  width: 100%;
  height: var(--photo-frame-height);
  min-height: 0;
  max-height: none;
  object-fit: cover;
}
.memory-crop[hidden] {display: none}
.memory-crop input {max-width: 8ch}
.letter-dialog{width:720px;max-height:calc(100dvh - 38px);border:1px solid #f8e6cd;overflow:hidden}
.letter-dialog>.close-button{position:absolute;top:12px;right:12px;z-index:5}
.letter-dialog .letter-paper{max-height:calc(100dvh - 40px);overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
.letter-paper{position:relative;isolation:isolate;padding:68px 66px 30px;background:linear-gradient(90deg,#9c745515,transparent 35px),repeating-linear-gradient(98deg,transparent 0 3px,#76545803 3px 4px),#fff3e0}
.letter-dialog::before{content:'';position:absolute;inset:17px;border:1px solid #bd9b7140;pointer-events:none;z-index:4}
.letter-dialog::after{content:'';position:absolute;width:30px;height:30px;right:0;bottom:0;background:linear-gradient(135deg,#eed4b8 48%,#d1ad8a 50%,#fff3e0 53%);clip-path:polygon(0 100%,100% 0,100% 100%);pointer-events:none;z-index:4}
.letter-keepsake{position:absolute;right:60px;top:35px;font:italic 66px/1 var(--serif);color:#aa826333;pointer-events:none}
.letter-paper .eyebrow{position:relative;z-index:1;max-width:80%;margin-bottom:27px}
.letter-paper h2, #letterBody, .letter-paper .letter-signature,
.letter-editor textarea[name="letter"] {
  font-family: Charm, Cormorant, Georgia, serif;
  font-weight: 400;
  color: #4b302b;
}
.letter-paper h2 {
  font-size: clamp(2.125rem, 6vw, 3.25rem);
  margin-bottom: 26px;
  line-height: 1.12;
  letter-spacing: -.025em;
}
.letter-paper #letterBody p {
  font-size: clamp(1.5rem, 3.6vw, 1.7rem);
  line-height: 1.38;
  color: inherit;
}
.letter-paper .letter-signature {
  font-size: clamp(2rem, 4.8vw, 2.625rem);
  font-style: normal;
  line-height: 1.25;
}
.letter-editor textarea[name="letter"] {font-size: 1.5rem; line-height: 1.38}
.letter-end{margin:28px 0 4px;color:#b18a63}.letter-paper>.text-button{margin-inline:auto;min-height:44px}
.handwritten-signature {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
  max-inline-size: 100%;
  vertical-align: top;
}
.handwritten-signature img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(100%, 16.5rem);
  max-height: clamp(8.75rem, 23vw, 10.5rem);
  object-fit: contain;
}
.signature-signer {
  font-size: clamp(1.35rem, 4.6vw, 1.625rem);
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere;
}
.signature-signer:empty {display: none}
.signature-editor {
  min-inline-size: 0;
  margin: 16px 0 24px;
  padding: 12px 16px 16px;
  border: 1px solid #bc9ca6;
  border-radius: 12px;
  color: #603f52;
  background: #fbefe4;
}
.signature-editor legend {font: italic 24px/1.2 var(--serif); padding: 0 7px}
.signature-editor .field-hint {font-size: .875rem; line-height: 1.55; margin: 0 0 10px}
.signature-editor #signaturePreview:not([hidden]) {
  display: block;
  max-width: min(100%, 240px);
  max-height: 100px;
  margin: 6px 0 14px;
  padding: 6px;
  background: #fff3e0;
}
.signature-actions {display: flex; flex-wrap: wrap; gap: 8px}
.signature-actions button {min-height: 44px}
.signature-actions [hidden], #signatureStatus:empty {display: none}
.signature-editor #signatureStatus:not(:empty) {margin: 10px 0 0}
.signature-editor #signatureStatus.error {color: #8f354d}
.secret-dialog{background:linear-gradient(135deg,#fff6e6,#f6e5d8)!important;border:1px solid #fff2de}.secret-dialog::after{content:'';position:absolute;inset:15px;border:1px solid #b38d7140;border-radius:2px;pointer-events:none}
.secret-choices button {
  --petal: #f5b3bf;
  width: min(100%, 265px);
  min-height: 44px;
  padding: 5px 12px;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 22px;
  transition: background .25s, border-color .25s;
}
.secret-choices .voice-flower-choice {
  --petal: #ffcf9e;
  background: #fff3df1f;
  border-color: #ffdfb885;
}
.secret-choices button:last-child { --petal: #dfc2f3 }
.secret-choices button:hover, .secret-choices button:focus-visible {
  background: #fff3df2c;
  border-color: #ffdfb8b0;
}
.secret-choice-flower {
  flex: 0 0 26px;
  height: 26px;
  background:
    radial-gradient(circle at 50% 52%, #fff1c2 0 11%, transparent 13%),
    radial-gradient(circle at 50% 25%, var(--petal) 0 19%, transparent 21%),
    radial-gradient(circle at 77% 44%, var(--petal) 0 19%, transparent 21%),
    radial-gradient(circle at 67% 74%, var(--petal) 0 19%, transparent 21%),
    radial-gradient(circle at 33% 74%, var(--petal) 0 19%, transparent 21%),
    radial-gradient(circle at 23% 44%, var(--petal) 0 19%, transparent 21%);
  filter: drop-shadow(0 1px 4px #5f294987);
}
body[data-motion="still"] .secret-choices button { transition: none }
.voice-keepsake {margin:22px auto 0; text-align:center}
.voice-keepsake button,.voice-actions button {min-height:44px;padding:10px 17px;border:1px solid #ad879480;border-radius:24px;color:#6b4558;background:#fff6eb;line-height:1.4;transition:background .22s,transform .22s}
.voice-keepsake button,.voice-actions .voice-record {display:inline-flex;align-items:center;justify-content:center;gap:10px;background:#794759;color:#fff6eb;border-color:#794759}
.voice-keepsake button:active,.voice-actions button:active {transform:scale(.975)}
.voice-keepsake small:not(:empty){display:block;margin:10px 0;color:#653f53}
.voice-keepsake button{min-width:min(208px,100%)}
.voice-wave {display:inline-flex;align-items:center;gap:2px;height:19px}
.voice-wave i {width:2px;height:7px;border-radius:2px;background:currentColor}
.voice-wave i:nth-child(even){height:14px}.voice-wave i:nth-child(3){height:19px}
body[data-motion="running"] #voicePlay[aria-pressed="true"] i {animation:voice-wave .76s ease-in-out infinite alternate}
.voice-wave i:nth-child(even){animation-delay:-.32s!important}
@keyframes voice-wave {to{transform:scaleY(.42)}}
.voice-editor {min-width:0;border:1px solid #bc9ca6;border-radius:12px;padding:16px;margin:22px 0;color:#603f52;background:#fbefe4}
.voice-editor legend {font:italic 26px/1.1 var(--serif);padding:0 7px}
.voice-editor .field-hint {display:block;margin:6px 0 10px;color:#715563;font-size:13px;line-height:1.6}
.voice-actions {display:flex;flex-wrap:wrap;gap:8px;margin:14px 0 8px}
.voice-actions button:disabled {opacity:.58}
.voice-editor #voiceClock {font-variant-numeric:tabular-nums;color:#804052}
#voiceReview {margin-top:14px;border-top:1px solid #cfb3b9;padding-top:12px}
#voiceFileName {display:block;overflow-wrap:anywhere;font-size:13px}
#voicePreview {display:block;width:100%;margin:8px 0}
#voiceRemove {color:#794759;min-height:44px;text-decoration:underline;text-underline-offset:3px}
.voice-actions [hidden],.voice-keepsake[hidden],#voiceReview[hidden]{display:none}
.letter-invitation {border-left:2px solid #c89ca3;padding-left:16px}
body[data-reading] .atmosphere{animation-play-state:paused}
body[data-reading] .paper-read{opacity:0;pointer-events:none}
#mainContent{transition:opacity .35s}
body[data-reading]:not([data-reading="editorDialog"]) #mainContent{opacity:.045}
body[data-reading]:not([data-reading="editorDialog"]) .masthead,body[data-reading]:not([data-reading="editorDialog"]) .footer{opacity:.24;transition:opacity .3s}
.masthead,.footer{transition:opacity .35s}
.fallback-envelope button{perspective:820px;background:linear-gradient(130deg,#ead4d3,#c59ba8);border-radius:3px;box-shadow:0 7px 15px #33203729}
.fallback-envelope button::before{display:none}
.fallback-pocket,.fallback-flap{position:absolute;inset:0;pointer-events:none}
.fallback-pocket{clip-path:polygon(0 0,50% 54%,100% 0,100% 100%,0 100%);background:conic-gradient(from 57deg at 50% 52%,#f4e2d0 0 70deg,#e4cfbb 71deg,#f8e8d7 72deg 178deg,#e2c9b7 179deg,#efdbca 180deg)}
.fallback-flap{height:69%;transform-origin:center top;transform-style:preserve-3d;transition:transform .85s cubic-bezier(.4,0,.22,1)}
.fallback-flap::before,.fallback-flap::after{content:'';position:absolute;inset:0;clip-path:polygon(0 0,100% 0,54% 97%,50% 100%,46% 97%);backface-visibility:hidden;background:linear-gradient(165deg,#fff3e3,#efdbc5)}
.fallback-flap::after{background:linear-gradient(35deg,#dcbbc4,#e7ced1);transform:rotateY(180deg)}
.fallback-flap .fallback-seal{left:50%;top:82%;width:14%;height:auto;aspect-ratio:1;transform:translate(-50%,-50%) translateZ(1px);border-radius:46% 51% 44% 49%;backface-visibility:hidden;background:#97586d;box-shadow:inset 0 0 0 3px #ba8591,0 1px 3px #7a496747;font-size:clamp(16px,2.5vw,23px)}
.fallback-envelope button[aria-expanded="true"] .fallback-flap{transform:rotateX(172deg)}
body[data-motion="still"] .fallback-flap{transition:none}
@media(max-width:760px){
  .paper-read{display:none}
  .memory-dialog{width:500px;max-height:91dvh}.memory-image-wrap{border:12px solid #fff3e0;border-bottom:0;height:280px;min-height:0;max-height:40dvh}.memory-copy{padding:29px 27px 24px;background:linear-gradient(#b99c8309,transparent 40%)}.memory-copy h2{font-size:37px}.memory-copy #memoryCaption{font-size:15px;line-height:1.8}
  .letter-dialog{max-height:calc(100dvh - 28px)}.letter-dialog .letter-paper{max-height:calc(100dvh - 30px)}.letter-paper{padding:58px 27px 25px}.letter-dialog::before{inset:11px}.letter-keepsake{right:31px;top:29px;font-size:53px}.letter-paper .eyebrow{font-size:9px;max-width:78%;letter-spacing:1.2px;margin-bottom:29px}.letter-paper>.text-button{font-size:12px}
}
@media(max-height:500px) and (max-width:900px){.memory-dialog[open]{grid-template-columns:1fr 1fr}.memory-image-wrap{height:100%;max-height:none;border:12px solid #fff3e0;border-right:0}.memory-copy{padding:55px 25px 25px}}
